diff options
| author | MagnumOpus21 <sivaauturic@gmail.com> | 2018-08-12 22:17:30 -0400 |
|---|---|---|
| committer | Siva Prasad <sivauturic@gmail.com> | 2018-09-05 08:56:00 -0400 |
| commit | efb88b40a179a30118f8d75b54f007151bb7e4c8 (patch) | |
| tree | c30dd037d3a53d28083fdf354aa810924cc4a2a0 | |
| parent | 3ae6d06edbf57ce61a1f41e297dba750baf15ecb (diff) | |
| download | rust-efb88b40a179a30118f8d75b54f007151bb7e4c8.tar.gz rust-efb88b40a179a30118f8d75b54f007151bb7e4c8.zip | |
Formatting errors rectified
| -rw-r--r-- | src/libcore/macros.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 2929fc9057d..1d0ac42de60 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -349,19 +349,24 @@ macro_rules! try { /// write!(&mut v, "s = {:?}", s).unwrap(); // uses io::Write::write_fmt /// assert_eq!(v, b"s = \"abc 123\""); /// ``` +/// /// Note : This macro can be used in no_std setups as well -/// In a no_std setup you are responsible for the +/// In a no_std setup you are responsible for the /// implementation details of the components. +/// /// ``` /// # extern crate core; /// use core::fmt::Write; +/// /// struct Example{ /// } +/// /// impl Write for Example{ /// fn write_str(&mut self, _s: &str) -> core::fmt::Result { /// unimplemented!(); /// } /// } +/// /// let mut m = Example{}; /// write!(&mut m, "Hello World").expect("Not written"); /// ``` @@ -734,4 +739,4 @@ mod builtin { ($cond:expr,) => ({ /* compiler built-in */ }); ($cond:expr, $($arg:tt)+) => ({ /* compiler built-in */ }); } -} \ No newline at end of file +} |
