Skip to content

Commit 1a3f68b

Browse files
committed
---
yaml --- r: 125398 b: refs/heads/auto c: ee8365a h: refs/heads/master v: v3
1 parent 0e56aba commit 1a3f68b

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
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 29cb9594d1105ff1ab00f11d16705b1c57e8287c
16+
refs/heads/auto: ee8365ad81115d79e1a33ef0c034c4a74cf01819
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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