Skip to content

Commit 4dc6079

Browse files
committed
---
yaml --- r: 55747 b: refs/heads/master c: bf4f088 h: refs/heads/master i: 55745: fb16fa0 55743: 945c85f v: v3
1 parent 0c6d5c9 commit 4dc6079

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 582a05fc95c8adf6ecf6318ea09ed6cd5bbe5b33
2+
refs/heads/master: bf4f088eaccfe24d4c30e7bf52e4c2bd20b9ff47
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
55
refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a

trunk/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)