Skip to content
Prev Previous commit
Next Next commit
Formatting errors rectified
  • Loading branch information
MagnumOpus21 authored and Siva Prasad committed Sep 5, 2018
commit efb88b40a179a30118f8d75b54f007151bb7e4c8
9 changes: 7 additions & 2 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
/// ```
Expand Down Expand Up @@ -734,4 +739,4 @@ mod builtin {
($cond:expr,) => ({ /* compiler built-in */ });
($cond:expr, $($arg:tt)+) => ({ /* compiler built-in */ });
}
}
}