@@ -74,7 +74,6 @@ impl<'self> AsciiCast<&'self[Ascii]> for &'self [u8] {
74
74
#[ inline( always) ]
75
75
fn to_ascii ( & self ) -> & ' self [ Ascii ] {
76
76
assert ! ( self . is_ascii( ) ) ;
77
-
78
77
unsafe { cast:: transmute ( * self ) }
79
78
}
80
79
@@ -91,7 +90,6 @@ impl<'self> AsciiCast<&'self[Ascii]> for &'self str {
91
90
#[ inline( always) ]
92
91
fn to_ascii ( & self ) -> & ' self [ Ascii ] {
93
92
assert ! ( self . is_ascii( ) ) ;
94
-
95
93
let ( p, len) : ( * u8 , uint ) = unsafe { cast:: transmute ( * self ) } ;
96
94
unsafe { cast:: transmute ( ( p, len - 1 ) ) }
97
95
}
@@ -119,7 +117,6 @@ impl AsciiCast<Ascii> for u8 {
119
117
}
120
118
121
119
impl AsciiCast < Ascii > for char {
122
-
123
120
#[ inline( always) ]
124
121
fn to_ascii ( & self ) -> Ascii {
125
122
assert ! ( self . is_ascii( ) ) ;
@@ -142,14 +139,14 @@ impl OwnedAsciiCast for ~[u8] {
142
139
#[ inline( always) ]
143
140
fn to_ascii_consume ( self ) -> ~[ Ascii ] {
144
141
assert ! ( self . is_ascii( ) ) ;
145
-
146
142
unsafe { cast:: transmute ( self ) }
147
143
}
148
144
}
149
145
150
146
impl OwnedAsciiCast for ~str {
151
147
#[ inline( always) ]
152
148
fn to_ascii_consume ( self ) -> ~[ Ascii ] {
149
+ assert ! ( self . is_ascii( ) ) ;
153
150
let mut s = self ;
154
151
unsafe {
155
152
str:: raw:: pop_byte ( & mut s) ;
@@ -269,11 +266,3 @@ mod tests {
269
266
#[ test] #[ should_fail]
270
267
fn test_ascii_fail_char_slice( ) { 'λ' . to_ascii( ) ; }
271
268
}
272
-
273
-
274
-
275
-
276
-
277
-
278
-
279
-
0 commit comments