File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ macro_rules! specialize_for_lengths {
9090 $num => {
9191 for s in iter {
9292 copy_slice_and_advance!( target, sep_bytes) ;
93- let content_bytes = s. borrow( ) . as_ref( ) ;
93+ let content_bytes: & [ _ ] = s. borrow( ) . as_ref( ) ;
9494 copy_slice_and_advance!( target, content_bytes) ;
9595 }
9696 } ,
@@ -99,7 +99,7 @@ macro_rules! specialize_for_lengths {
9999 // arbitrary non-zero size fallback
100100 for s in iter {
101101 copy_slice_and_advance!( target, sep_bytes) ;
102- let content_bytes = s. borrow( ) . as_ref( ) ;
102+ let content_bytes: & [ _ ] = s. borrow( ) . as_ref( ) ;
103103 copy_slice_and_advance!( target, content_bytes) ;
104104 }
105105 }
Original file line number Diff line number Diff line change @@ -201,7 +201,13 @@ impl AsRef<ByteStr> for ByteStr {
201201 }
202202}
203203
204- // `impl AsRef<ByteStr> for [u8]` omitted to avoid widespread inference failures
204+ #[ unstable( feature = "bstr" , issue = "134915" ) ]
205+ impl AsRef < ByteStr > for [ u8 ] {
206+ #[ inline]
207+ fn as_ref ( & self ) -> & ByteStr {
208+ ByteStr :: new ( self )
209+ }
210+ }
205211
206212#[ unstable( feature = "bstr" , issue = "134915" ) ]
207213impl AsRef < ByteStr > for str {
You can’t perform that action at this time.
0 commit comments