6
6
use core:: borrow:: { Borrow , BorrowMut } ;
7
7
#[ unstable( feature = "bstr" , issue = "134915" ) ]
8
8
pub use core:: bstr:: ByteStr ;
9
- use core:: bstr:: { impl_partial_eq, impl_partial_eq_ord , impl_partial_eq_ord_n } ;
9
+ use core:: bstr:: { impl_partial_eq, impl_partial_eq_n , impl_partial_eq_ord } ;
10
10
use core:: cmp:: Ordering ;
11
11
use core:: ops:: {
12
12
Deref , DerefMut , DerefPure , Index , IndexMut , Range , RangeFrom , RangeFull , RangeInclusive ,
@@ -165,21 +165,8 @@ impl Borrow<ByteStr> for ByteString {
165
165
}
166
166
}
167
167
168
- #[ unstable( feature = "bstr" , issue = "134915" ) ]
169
- impl Borrow < ByteStr > for Vec < u8 > {
170
- #[ inline]
171
- fn borrow ( & self ) -> & ByteStr {
172
- ByteStr :: from_bytes ( self . as_slice ( ) )
173
- }
174
- }
175
-
176
- #[ unstable( feature = "bstr" , issue = "134915" ) ]
177
- impl Borrow < ByteStr > for String {
178
- #[ inline]
179
- fn borrow ( & self ) -> & ByteStr {
180
- ByteStr :: from_bytes ( self . as_bytes ( ) )
181
- }
182
- }
168
+ // `impl Borrow<ByteStr> for Vec<u8>` omitted to avoid inference failures
169
+ // `impl Borrow<ByteStr> for String` omitted to avoid inference failures
183
170
184
171
#[ unstable( feature = "bstr" , issue = "134915" ) ]
185
172
impl BorrowMut < [ u8 ] > for ByteString {
@@ -197,13 +184,7 @@ impl BorrowMut<ByteStr> for ByteString {
197
184
}
198
185
}
199
186
200
- #[ unstable( feature = "bstr" , issue = "134915" ) ]
201
- impl BorrowMut < ByteStr > for Vec < u8 > {
202
- #[ inline]
203
- fn borrow_mut ( & mut self ) -> & mut ByteStr {
204
- ByteStr :: from_bytes_mut ( self . as_mut_slice ( ) )
205
- }
206
- }
187
+ // `impl BorrowMut<ByteStr> for Vec<u8>` omitted to avoid inference failures
207
188
208
189
#[ unstable( feature = "bstr" , issue = "134915" ) ]
209
190
impl Default for ByteString {
@@ -563,20 +544,24 @@ macro_rules! impl_partial_eq_ord_cow {
563
544
} ;
564
545
}
565
546
566
- impl_partial_eq_ord ! ( ByteString , Vec <u8 >) ;
547
+ // PartialOrd with `Vec<u8>` omitted to avoid inference failures
548
+ impl_partial_eq ! ( ByteString , Vec <u8 >) ;
567
549
// PartialOrd with `[u8]` omitted to avoid inference failures
568
550
impl_partial_eq ! ( ByteString , [ u8 ] ) ;
569
551
// PartialOrd with `&[u8]` omitted to avoid inference failures
570
552
impl_partial_eq ! ( ByteString , & [ u8 ] ) ;
571
- impl_partial_eq_ord ! ( ByteString , String ) ;
553
+ // PartialOrd with `String` omitted to avoid inference failures
554
+ impl_partial_eq ! ( ByteString , String ) ;
572
555
// PartialOrd with `str` omitted to avoid inference failures
573
556
impl_partial_eq ! ( ByteString , str ) ;
574
557
// PartialOrd with `&str` omitted to avoid inference failures
575
558
impl_partial_eq ! ( ByteString , & str ) ;
576
559
impl_partial_eq_ord ! ( ByteString , ByteStr ) ;
577
560
impl_partial_eq_ord ! ( ByteString , & ByteStr ) ;
578
- impl_partial_eq_ord_n ! ( ByteString , [ u8 ; N ] ) ;
579
- impl_partial_eq_ord_n ! ( ByteString , & [ u8 ; N ] ) ;
561
+ // PartialOrd with `[u8; N]` omitted to avoid inference failures
562
+ impl_partial_eq_n ! ( ByteString , [ u8 ; N ] ) ;
563
+ // PartialOrd with `&[u8; N]` omitted to avoid inference failures
564
+ impl_partial_eq_n ! ( ByteString , & [ u8 ; N ] ) ;
580
565
impl_partial_eq_ord_cow ! ( ByteString , Cow <' _, ByteStr >) ;
581
566
impl_partial_eq_ord_cow ! ( ByteString , Cow <' _, str >) ;
582
567
impl_partial_eq_ord_cow ! ( ByteString , Cow <' _, [ u8 ] >) ;
0 commit comments