@@ -9,53 +9,53 @@ fn empty() {
99#[ test]
1010fn basic ( ) {
1111 let mut buf = HtmlWithLimit :: new ( 60 ) ;
12- buf. push ( "Hello " ) ;
12+ let _ = buf. push ( "Hello " ) ;
1313 buf. open_tag ( "em" ) ;
14- buf. push ( "world" ) ;
14+ let _ = buf. push ( "world" ) ;
1515 buf. close_tag ( ) ;
16- buf. push ( "!" ) ;
16+ let _ = buf. push ( "!" ) ;
1717 assert_eq ! ( buf. finish( ) , "Hello <em>world</em>!" ) ;
1818}
1919
2020#[ test]
2121fn no_tags ( ) {
2222 let mut buf = HtmlWithLimit :: new ( 60 ) ;
23- buf. push ( "Hello" ) ;
24- buf. push ( " world!" ) ;
23+ let _ = buf. push ( "Hello" ) ;
24+ let _ = buf. push ( " world!" ) ;
2525 assert_eq ! ( buf. finish( ) , "Hello world!" ) ;
2626}
2727
2828#[ test]
2929fn limit_0 ( ) {
3030 let mut buf = HtmlWithLimit :: new ( 0 ) ;
31- buf. push ( "Hello " ) ;
31+ let _ = buf. push ( "Hello " ) ;
3232 buf. open_tag ( "em" ) ;
33- buf. push ( "world" ) ;
33+ let _ = buf. push ( "world" ) ;
3434 buf. close_tag ( ) ;
35- buf. push ( "!" ) ;
35+ let _ = buf. push ( "!" ) ;
3636 assert_eq ! ( buf. finish( ) , "" ) ;
3737}
3838
3939#[ test]
4040fn exactly_limit ( ) {
4141 let mut buf = HtmlWithLimit :: new ( 12 ) ;
42- buf. push ( "Hello " ) ;
42+ let _ = buf. push ( "Hello " ) ;
4343 buf. open_tag ( "em" ) ;
44- buf. push ( "world" ) ;
44+ let _ = buf. push ( "world" ) ;
4545 buf. close_tag ( ) ;
46- buf. push ( "!" ) ;
46+ let _ = buf. push ( "!" ) ;
4747 assert_eq ! ( buf. finish( ) , "Hello <em>world</em>!" ) ;
4848}
4949
5050#[ test]
5151fn multiple_nested_tags ( ) {
5252 let mut buf = HtmlWithLimit :: new ( 60 ) ;
5353 buf. open_tag ( "p" ) ;
54- buf. push ( "This is a " ) ;
54+ let _ = buf. push ( "This is a " ) ;
5555 buf. open_tag ( "em" ) ;
56- buf. push ( "paragraph" ) ;
56+ let _ = buf. push ( "paragraph" ) ;
5757 buf. open_tag ( "strong" ) ;
58- buf. push ( "!" ) ;
58+ let _ = buf. push ( "!" ) ;
5959 buf. close_tag ( ) ;
6060 buf. close_tag ( ) ;
6161 buf. close_tag ( ) ;
@@ -66,11 +66,11 @@ fn multiple_nested_tags() {
6666fn forgot_to_close_tags ( ) {
6767 let mut buf = HtmlWithLimit :: new ( 60 ) ;
6868 buf. open_tag ( "p" ) ;
69- buf. push ( "This is a " ) ;
69+ let _ = buf. push ( "This is a " ) ;
7070 buf. open_tag ( "em" ) ;
71- buf. push ( "paragraph" ) ;
71+ let _ = buf. push ( "paragraph" ) ;
7272 buf. open_tag ( "strong" ) ;
73- buf. push ( "!" ) ;
73+ let _ = buf. push ( "!" ) ;
7474 assert_eq ! ( buf. finish( ) , "<p>This is a <em>paragraph<strong>!</strong></em></p>" ) ;
7575}
7676
@@ -80,8 +80,8 @@ fn past_the_limit() {
8080 buf. open_tag ( "p" ) ;
8181 ( 0 ..10 ) . try_for_each ( |n| {
8282 buf. open_tag ( "strong" ) ;
83- buf. push ( "word#" ) ?;
84- buf. push ( & n. to_string ( ) ) ?;
83+ let _ = buf. push ( "word#" ) ?;
84+ let _ = buf. push ( & n. to_string ( ) ) ?;
8585 buf. close_tag ( ) ;
8686 ControlFlow :: Continue ( ( ) )
8787 } ) ;
@@ -100,8 +100,8 @@ fn past_the_limit() {
100100fn quickly_past_the_limit ( ) {
101101 let mut buf = HtmlWithLimit :: new ( 6 ) ;
102102 buf. open_tag ( "p" ) ;
103- buf. push ( "Hello" ) ;
104- buf. push ( " World" ) ;
103+ let _ = buf. push ( "Hello" ) ;
104+ let _ = buf. push ( " World" ) ;
105105 // intentionally not closing <p> before finishing
106106 assert_eq ! ( buf. finish( ) , "<p>Hello</p>" ) ;
107107}
@@ -110,7 +110,7 @@ fn quickly_past_the_limit() {
110110fn close_too_many ( ) {
111111 let mut buf = HtmlWithLimit :: new ( 60 ) ;
112112 buf. open_tag ( "p" ) ;
113- buf. push ( "Hello" ) ;
113+ let _ = buf. push ( "Hello" ) ;
114114 buf. close_tag ( ) ;
115115 // This call does not panic because there are valid cases
116116 // where `close_tag()` is called with no tags left to close.
0 commit comments