@@ -349,34 +349,22 @@ macro_rules! try {
349
349
/// write!(&mut v, "s = {:?}", s).unwrap(); // uses io::Write::write_fmt
350
350
/// assert_eq!(v, b"s = \"abc 123\"");
351
351
/// ```
352
-
353
- /// /// Note : This macro can be used in no_std setups as well
354
- /// /// In a no_std setup you are responsible for the
355
- /// /// implementation details of the components.
356
-
357
- /// ```rust
358
- /// extern crate core;
352
+ /// Note : This macro can be used in no_std setups as well
353
+ /// In a no_std setup you are responsible for the
354
+ /// implementation details of the components.
355
+ /// ```
356
+ /// # extern crate core;
359
357
/// use core::fmt::Write;
360
-
361
- /// #[derive(Debug)]
362
- /// struct Greetings<'a>{
363
- /// message : &'a str,
358
+ /// struct Example{
364
359
/// }
365
-
366
-
367
- /// impl<'a> Write for Greetings<'a>{
360
+ /// impl Write for Example{
368
361
/// fn write_str(&mut self, _s: &str) -> core::fmt::Result {
369
362
/// unimplemented!();
370
363
/// }
371
364
/// }
372
-
373
- /// fn main(){
374
- /// let mut m = Greetings{message: ""};
375
- /// write!(&mut m, "Hello World").expect("Not written");
376
- /// }
365
+ /// let mut m = Example{};
366
+ /// write!(&mut m, "Hello World").expect("Not written");
377
367
/// ```
378
-
379
-
380
368
#[ macro_export]
381
369
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
382
370
macro_rules! write {
@@ -746,4 +734,4 @@ mod builtin {
746
734
( $cond: expr, ) => ( { /* compiler built-in */ } ) ;
747
735
( $cond: expr, $( $arg: tt) +) => ( { /* compiler built-in */ } ) ;
748
736
}
749
- }
737
+ }
0 commit comments