Skip to content

Commit adda18e

Browse files
committed
---
yaml --- r: 56358 b: refs/heads/auto c: bf4f088 h: refs/heads/master v: v3
1 parent 10f5be1 commit adda18e

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 582a05fc95c8adf6ecf6318ea09ed6cd5bbe5b33
17+
refs/heads/auto: bf4f088eaccfe24d4c30e7bf52e4c2bd20b9ff47
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/src/libcore/str/ascii.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ impl<'self> AsciiCast<&'self[Ascii]> for &'self [u8] {
7474
#[inline(always)]
7575
fn to_ascii(&self) -> &'self[Ascii] {
7676
assert!(self.is_ascii());
77-
7877
unsafe{ cast::transmute(*self) }
7978
}
8079

@@ -91,7 +90,6 @@ impl<'self> AsciiCast<&'self[Ascii]> for &'self str {
9190
#[inline(always)]
9291
fn to_ascii(&self) -> &'self[Ascii] {
9392
assert!(self.is_ascii());
94-
9593
let (p,len): (*u8, uint) = unsafe{ cast::transmute(*self) };
9694
unsafe{ cast::transmute((p, len - 1))}
9795
}
@@ -119,7 +117,6 @@ impl AsciiCast<Ascii> for u8 {
119117
}
120118

121119
impl AsciiCast<Ascii> for char {
122-
123120
#[inline(always)]
124121
fn to_ascii(&self) -> Ascii {
125122
assert!(self.is_ascii());
@@ -142,14 +139,14 @@ impl OwnedAsciiCast for ~[u8] {
142139
#[inline(always)]
143140
fn to_ascii_consume(self) -> ~[Ascii] {
144141
assert!(self.is_ascii());
145-
146142
unsafe {cast::transmute(self)}
147143
}
148144
}
149145

150146
impl OwnedAsciiCast for ~str {
151147
#[inline(always)]
152148
fn to_ascii_consume(self) -> ~[Ascii] {
149+
assert!(self.is_ascii());
153150
let mut s = self;
154151
unsafe {
155152
str::raw::pop_byte(&mut s);
@@ -269,11 +266,3 @@ mod tests {
269266
#[test] #[should_fail]
270267
fn test_ascii_fail_char_slice() { 'λ'.to_ascii(); }
271268
}
272-
273-
274-
275-
276-
277-
278-
279-

0 commit comments

Comments
 (0)