Skip to content

Commit 949e2ab

Browse files
committed
---
yaml --- r: 126020 b: refs/heads/try c: ee8365a h: refs/heads/master v: v3
1 parent aa35b4f commit 949e2ab

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: f2fa55903e378368ed9173560f03a0ef16e371c2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 9fc8394d3bce22ab483f98842434c84c396212ae
5-
refs/heads/try: 29cb9594d1105ff1ab00f11d16705b1c57e8287c
5+
refs/heads/try: ee8365ad81115d79e1a33ef0c034c4a74cf01819
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libstd/ascii.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -400,12 +400,12 @@ pub trait StrAsciiExt {
400400
impl<'a> StrAsciiExt for &'a str {
401401
#[inline]
402402
fn to_ascii_upper(&self) -> String {
403-
unsafe { str_copy_map_bytes(*self, ASCII_UPPER_MAP) }
403+
unsafe { str_copy_map_bytes(*self, &ASCII_UPPER_MAP) }
404404
}
405405

406406
#[inline]
407407
fn to_ascii_lower(&self) -> String {
408-
unsafe { str_copy_map_bytes(*self, ASCII_LOWER_MAP) }
408+
unsafe { str_copy_map_bytes(*self, &ASCII_LOWER_MAP) }
409409
}
410410

411411
#[inline]
@@ -422,17 +422,17 @@ impl<'a> StrAsciiExt for &'a str {
422422
impl OwnedStrAsciiExt for String {
423423
#[inline]
424424
fn into_ascii_upper(self) -> String {
425-
unsafe { str_map_bytes(self, ASCII_UPPER_MAP) }
425+
unsafe { str_map_bytes(self, &ASCII_UPPER_MAP) }
426426
}
427427

428428
#[inline]
429429
fn into_ascii_lower(self) -> String {
430-
unsafe { str_map_bytes(self, ASCII_LOWER_MAP) }
430+
unsafe { str_map_bytes(self, &ASCII_LOWER_MAP) }
431431
}
432432
}
433433

434434
#[inline]
435-
unsafe fn str_map_bytes(string: String, map: &'static [u8]) -> String {
435+
unsafe fn str_map_bytes(string: String, map: &[u8, ..256]) -> String {
436436
let mut bytes = string.into_bytes();
437437

438438
for b in bytes.mut_iter() {
@@ -443,15 +443,15 @@ unsafe fn str_map_bytes(string: String, map: &'static [u8]) -> String {
443443
}
444444

445445
#[inline]
446-
unsafe fn str_copy_map_bytes(string: &str, map: &'static [u8]) -> String {
446+
unsafe fn str_copy_map_bytes(string: &str, map: &[u8, ..256]) -> String {
447447
let mut s = String::from_str(string);
448448
for b in s.as_mut_bytes().mut_iter() {
449449
*b = map[*b as uint];
450450
}
451451
s.into_string()
452452
}
453453

454-
static ASCII_LOWER_MAP: &'static [u8] = &[
454+
pub static ASCII_LOWER_MAP: [u8, ..256] = [
455455
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
456456
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
457457
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
@@ -490,7 +490,7 @@ static ASCII_LOWER_MAP: &'static [u8] = &[
490490
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
491491
];
492492

493-
static ASCII_UPPER_MAP: &'static [u8] = &[
493+
pub static ASCII_UPPER_MAP: [u8, ..256] = [
494494
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
495495
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
496496
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,

0 commit comments

Comments
 (0)