File tree 2 files changed +5
-2
lines changed 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ macro_rules! json_internal {
161
161
162
162
// Insert the current entry followed by trailing comma.
163
163
( @object $object: ident [ $( $key: tt) +] ( $value: expr) , $( $rest: tt) * ) => {
164
- $object. insert( ( $( $key) +) . into( ) , $value) ;
164
+ let _ = $object. insert( ( $( $key) +) . into( ) , $value) ;
165
165
json_internal!( @object $object ( ) ( $( $rest) * ) ( $( $rest) * ) ) ;
166
166
} ;
167
167
@@ -172,7 +172,7 @@ macro_rules! json_internal {
172
172
173
173
// Insert the last entry without trailing comma.
174
174
( @object $object: ident [ $( $key: tt) +] ( $value: expr) ) => {
175
- $object. insert( ( $( $key) +) . into( ) , $value) ;
175
+ let _ = $object. insert( ( $( $key) +) . into( ) , $value) ;
176
176
} ;
177
177
178
178
// Next value is `null`.
Original file line number Diff line number Diff line change @@ -1847,6 +1847,9 @@ fn test_json_macro() {
1847
1847
( <Result <& str , ( ) > as Clone >:: clone( & Ok ( "" ) ) . unwrap( ) ) : "ok" ,
1848
1848
( <Result <( ) , & str > as Clone >:: clone( & Err ( "" ) ) . unwrap_err( ) ) : "err"
1849
1849
} ) ;
1850
+
1851
+ #[ deny( unused_results) ]
1852
+ let _ = json ! ( { "architecture" : [ true , null] } ) ;
1850
1853
}
1851
1854
1852
1855
#[ test]
You can’t perform that action at this time.
0 commit comments