mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Formatting errors rectified
This commit is contained in:
parent
3ae6d06edb
commit
efb88b40a1
@ -349,19 +349,24 @@ macro_rules! try {
|
|||||||
/// write!(&mut v, "s = {:?}", s).unwrap(); // uses io::Write::write_fmt
|
/// write!(&mut v, "s = {:?}", s).unwrap(); // uses io::Write::write_fmt
|
||||||
/// assert_eq!(v, b"s = \"abc 123\"");
|
/// assert_eq!(v, b"s = \"abc 123\"");
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
/// Note : This macro can be used in no_std setups as well
|
/// 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.
|
/// implementation details of the components.
|
||||||
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # extern crate core;
|
/// # extern crate core;
|
||||||
/// use core::fmt::Write;
|
/// use core::fmt::Write;
|
||||||
|
///
|
||||||
/// struct Example{
|
/// struct Example{
|
||||||
/// }
|
/// }
|
||||||
|
///
|
||||||
/// impl Write for Example{
|
/// impl Write for Example{
|
||||||
/// fn write_str(&mut self, _s: &str) -> core::fmt::Result {
|
/// fn write_str(&mut self, _s: &str) -> core::fmt::Result {
|
||||||
/// unimplemented!();
|
/// unimplemented!();
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
|
///
|
||||||
/// let mut m = Example{};
|
/// let mut m = Example{};
|
||||||
/// write!(&mut m, "Hello World").expect("Not written");
|
/// write!(&mut m, "Hello World").expect("Not written");
|
||||||
/// ```
|
/// ```
|
||||||
|
Loading…
Reference in New Issue
Block a user