File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 14
14
15
15
use std:: fmt;
16
16
use std:: mem;
17
- use std:: borrow:: BorrowFrom ;
17
+ use std:: borrow:: Borrow ;
18
18
use std:: ascii:: AsciiExt ;
19
19
20
20
/// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero.
@@ -207,16 +207,13 @@ impl AsciiCast for char {
207
207
}
208
208
209
209
/// Trait for copyless casting to an ascii vector.
210
- pub trait OwnedAsciiCast < T : ?Sized , U = Self > : Sized
211
- where T : BorrowFrom < Self > + AsciiExt < U > {
210
+ pub trait OwnedAsciiCast < T : ?Sized > : Sized + Borrow < T >
211
+ where T : AsciiExt < Owned = Self > {
212
212
/// Take ownership and cast to an ascii vector. On non-ASCII input return ownership of data
213
213
/// that was attempted to cast to ascii in `Err(Self)`.
214
214
#[ inline]
215
215
fn into_ascii ( self ) -> Result < Vec < Ascii > , Self > {
216
- if {
217
- let borrowed: & T = BorrowFrom :: borrow_from ( & self ) ;
218
- borrowed. is_ascii ( )
219
- } {
216
+ if self . borrow ( ) . is_ascii ( ) {
220
217
Ok ( unsafe { self . into_ascii_nocheck ( ) } )
221
218
} else {
222
219
Err ( self )
You can’t perform that action at this time.
0 commit comments