Skip to content

Commit 0c24407

Browse files
committed
---
yaml --- r: 57714 b: refs/heads/incoming c: bf4f088 h: refs/heads/master v: v3
1 parent 48c6be4 commit 0c24407

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
@@ -6,7 +6,7 @@ refs/heads/try: bf67eb2362b7d0f37012f2d6dac604c3bbacd2c6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: 582a05fc95c8adf6ecf6318ea09ed6cd5bbe5b33
9+
refs/heads/incoming: bf4f088eaccfe24d4c30e7bf52e4c2bd20b9ff47
1010
refs/heads/dist-snap: 00dbbd01c2aee72982b3e0f9511ae1d4428c3ba9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/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)