11#![ deny( warnings) ]
2- #![ allow( unused_must_use) ]
32
43use std:: cell:: RefCell ;
54use std:: fmt:: { self , Write } ;
@@ -241,15 +240,15 @@ fn test_format_macro_interface() {
241240#[ test]
242241fn test_write ( ) {
243242 let mut buf = String :: new ( ) ;
244- write ! ( & mut buf, "{}" , 3 ) ;
243+ let _ = write ! ( & mut buf, "{}" , 3 ) ;
245244 {
246245 let w = & mut buf;
247- write ! ( w, "{foo}" , foo = 4 ) ;
248- write ! ( w, "{}" , "hello" ) ;
249- writeln ! ( w, "{}" , "line" ) ;
250- writeln ! ( w, "{foo}" , foo = "bar" ) ;
251- w. write_char ( '☃' ) ;
252- w. write_str ( "str" ) ;
246+ let _ = write ! ( w, "{foo}" , foo = 4 ) ;
247+ let _ = write ! ( w, "{}" , "hello" ) ;
248+ let _ = writeln ! ( w, "{}" , "line" ) ;
249+ let _ = writeln ! ( w, "{foo}" , foo = "bar" ) ;
250+ let _ = w. write_char ( '☃' ) ;
251+ let _ = w. write_str ( "str" ) ;
253252 }
254253
255254 t ! ( buf, "34helloline\n bar\n ☃str" ) ;
@@ -273,9 +272,9 @@ fn test_format_args() {
273272 let mut buf = String :: new ( ) ;
274273 {
275274 let w = & mut buf;
276- write ! ( w, "{}" , format_args!( "{}" , 1 ) ) ;
277- write ! ( w, "{}" , format_args!( "test" ) ) ;
278- write ! ( w, "{}" , format_args!( "{test}" , test = 3 ) ) ;
275+ let _ = write ! ( w, "{}" , format_args!( "{}" , 1 ) ) ;
276+ let _ = write ! ( w, "{}" , format_args!( "test" ) ) ;
277+ let _ = write ! ( w, "{}" , format_args!( "{test}" , test = 3 ) ) ;
279278 }
280279 let s = buf;
281280 t ! ( s, "1test3" ) ;
0 commit comments