File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -235,8 +235,7 @@ impl AsRef<[u8]> for ZString {
235235
236236impl < Rhs : AsRef < [ u8 ] > > PartialEq < Rhs > for ZString {
237237 fn eq ( & self , other : & Rhs ) -> bool {
238- let this: & [ u8 ] = self . as_ref ( ) ;
239- this == other. as_ref ( )
238+ AsRef :: < [ u8 ] > :: as_ref ( self ) == other. as_ref ( )
240239 }
241240}
242241
Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ pub fn integrate(module: &mut Module) {
1818 assert_eq ! ( zs. to_str( ) ?, "hello" ) ;
1919
2020 let zs = ZString :: new ( [ 1 , 2 , 3 ] ) ;
21- let zs: & [ u8 ] = zs. as_ref ( ) ;
22- assert_eq ! ( zs, & [ 1 , 2 , 3 ] ) ;
21+ assert_eq ! ( AsRef :: <[ u8 ] >:: as_ref( & zs) , & [ 1 , 2 , 3 ] ) ;
2322
2423 assert ! ( ZString :: new( "hello" ) == ZString :: new( b"hello" ) ) ;
2524
@@ -34,8 +33,7 @@ pub fn integrate(module: &mut Module) {
3433 assert_eq ! ( zs. to_str( ) ?, "persistent_hello" ) ;
3534
3635 let zs = ZString :: new_persistent ( [ 4 , 5 , 6 ] ) ;
37- let zs: & [ u8 ] = zs. as_ref ( ) ;
38- assert_eq ! ( zs, & [ 4 , 5 , 6 ] ) ;
36+ assert_eq ! ( AsRef :: <[ u8 ] >:: as_ref( & zs) , & [ 4 , 5 , 6 ] ) ;
3937
4038 assert ! (
4139 ZString :: new_persistent( "persistent" ) == ZString :: new_persistent( b"persistent" )
You can’t perform that action at this time.
0 commit comments