We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98a6fb8 commit d14d6cdCopy full SHA for d14d6cd
src/fmt.rs
@@ -0,0 +1,17 @@
1
+//! Implementation of `core::fmt::Write` for the HAL's `serial::Write`.
2
+//!
3
+//! TODO write example of usage
4
+use core::fmt::{Result, Write};
5
+
6
+impl<Word, Error> Write for ::serial::Write<Word, Error=Error>
7
+where
8
+ Word: From<u8>,
9
+{
10
+ fn write_str(&mut self, s: &str) -> Result {
11
+ let _ = s.as_bytes()
12
+ .into_iter()
13
+ .map(|c| block!(self.write(Word::from(*c))))
14
+ .last();
15
+ Ok(())
16
+ }
17
+}
src/lib.rs
@@ -692,6 +692,7 @@ extern crate void;
692
pub mod adc;
693
pub mod blocking;
694
pub mod digital;
695
+pub mod fmt;
696
pub mod prelude;
697
pub mod serial;
698
pub mod spi;
0 commit comments