diff options
author | 2020-10-14 10:47:08 +0000 | |
---|---|---|
committer | 2020-10-14 10:47:08 +0000 | |
commit | 55d67fad459aac4d9f14571f305a8983f36138cb (patch) | |
tree | dd59b1f1eec5f8a5038ec4b34fc0e94982c9cc0c /cortex-m-semihosting/src/lib.rs | |
parent | 432e5f527430394570d1d07454e26cc41d5b2936 (diff) | |
parent | 320881e0b57d16a4f768a7c8543571e26113e904 (diff) | |
download | cortex-m-55d67fad459aac4d9f14571f305a8983f36138cb.tar.gz cortex-m-55d67fad459aac4d9f14571f305a8983f36138cb.tar.zst cortex-m-55d67fad459aac4d9f14571f305a8983f36138cb.zip |
Merge #269
269: Merge HStdout and HStderr into the same type r=jonas-schievink a=adamgreig
As the next step in https://github.com/rust-embedded/cortex-m/pull/263#pullrequestreview-495095345, this PR applies https://github.com/rust-embedded/cortex-m-semihosting/pull/41 to this repository.
@m-ou-se, I tried exporting a patch from cortex-m-semihosting and applying it here but it didn't work first time, so I ended up just copying the changes. I've set you as the author of the commit and marked it as committed-by me, I hope you're OK with that but please let me know if you'd like it changed. (Also, thanks again for the PR, sorry it's taken over a year...).
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
Diffstat (limited to 'cortex-m-semihosting/src/lib.rs')
-rw-r--r-- | cortex-m-semihosting/src/lib.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/cortex-m-semihosting/src/lib.rs b/cortex-m-semihosting/src/lib.rs index b70dea0..de52ae1 100644 --- a/cortex-m-semihosting/src/lib.rs +++ b/cortex-m-semihosting/src/lib.rs @@ -25,7 +25,7 @@ //! //! # Example //! -//! ## Using `hio::HStdout` +//! ## Using `hio::hstdout` //! //! This example will demonstrate how to print formatted strings. //! @@ -35,11 +35,7 @@ //! //! // This function will be called by the application //! fn print() -> Result<(), core::fmt::Error> { -//! let mut stdout = match hio::hstdout() { -//! Ok(fd) => fd, -//! Err(()) => return Err(core::fmt::Error), -//! }; -//! +//! let mut stdout = hio::hstdout().map_err(|_| core::fmt::Error)?; //! let language = "Rust"; //! let ranking = 1; //! |