Skip to content

Commit c466adf

Browse files
committed
---
yaml --- r: 162526 b: refs/heads/try c: 6733d8b h: refs/heads/master v: v3
1 parent 3db0b10 commit c466adf

File tree

4 files changed

+23
-16
lines changed

4 files changed

+23
-16
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: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cafe2966770ff377aad6dd9fd808e68055587c58
5-
refs/heads/try: 7ce2d9c3fa3d36ae79b9790e3646e5e746e64cf4
5+
refs/heads/try: 6733d8b483d26d305397b528c5afb834027f40ce
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libstd/ascii.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
//! Operations on ASCII strings and characters
1414
1515
#![unstable = "unsure about placement and naming"]
16+
#![allow(deprecated)]
1617

1718
use core::kinds::Sized;
1819
use fmt;
@@ -36,6 +37,7 @@ impl Ascii {
3637
self.chr
3738
}
3839

40+
/// Deprecated: use `as_byte` isntead.
3941
#[deprecated = "use as_byte"]
4042
pub fn to_byte(self) -> u8 {
4143
self.as_byte()
@@ -48,6 +50,12 @@ impl Ascii {
4850
self.chr as char
4951
}
5052

53+
/// Deprecated: use `as_char` isntead.
54+
#[deprecated = "use as_char"]
55+
pub fn to_char(self) -> char {
56+
self.as_char()
57+
}
58+
5159
/// Convert to lowercase.
5260
#[inline]
5361
#[stable]

branches/try/src/libstd/path/windows.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ impl GenericPathUnsafe for Path {
235235
let repr = me.repr.as_slice();
236236
match me.prefix {
237237
Some(DiskPrefix) => {
238-
repr.as_bytes()[0] == path.as_bytes()[0].to_ascii().to_uppercase().to_byte()
238+
repr.as_bytes()[0] == path.as_bytes()[0].to_ascii().to_uppercase().as_byte()
239239
}
240240
Some(VerbatimDiskPrefix) => {
241-
repr.as_bytes()[4] == path.as_bytes()[0].to_ascii().to_uppercase().to_byte()
241+
repr.as_bytes()[4] == path.as_bytes()[0].to_ascii().to_uppercase().as_byte()
242242
}
243243
_ => false
244244
}
@@ -673,14 +673,17 @@ impl Path {
673673
match (self.prefix, other.prefix) {
674674
(Some(DiskPrefix), Some(VerbatimDiskPrefix)) => {
675675
self.is_absolute() &&
676-
s_repr.as_bytes()[0].to_ascii().eq_ignore_case(o_repr.as_bytes()[4].to_ascii())
676+
s_repr.as_bytes()[0].to_ascii().to_lowercase() ==
677+
o_repr.as_bytes()[4].to_ascii().to_lowercase()
677678
}
678679
(Some(VerbatimDiskPrefix), Some(DiskPrefix)) => {
679680
other.is_absolute() &&
680-
s_repr.as_bytes()[4].to_ascii().eq_ignore_case(o_repr.as_bytes()[0].to_ascii())
681+
s_repr.as_bytes()[4].to_ascii().to_lowercase() ==
682+
o_repr.as_bytes()[0].to_ascii().to_lowercase()
681683
}
682684
(Some(VerbatimDiskPrefix), Some(VerbatimDiskPrefix)) => {
683-
s_repr.as_bytes()[4].to_ascii().eq_ignore_case(o_repr.as_bytes()[4].to_ascii())
685+
s_repr.as_bytes()[4].to_ascii().to_lowercase() ==
686+
o_repr.as_bytes()[4].to_ascii().to_lowercase()
684687
}
685688
(Some(UNCPrefix(_,_)), Some(VerbatimUNCPrefix(_,_))) => {
686689
s_repr.slice(2, self.prefix_len()) == o_repr.slice(8, other.prefix_len())
@@ -747,10 +750,7 @@ impl Path {
747750
let mut s = String::from_str(s.slice_to(len));
748751
unsafe {
749752
let v = s.as_mut_vec();
750-
v[0] = (*v)[0]
751-
.to_ascii()
752-
.to_uppercase()
753-
.to_byte();
753+
v[0] = (*v)[0].to_ascii().to_uppercase().as_byte();
754754
}
755755
if is_abs {
756756
// normalize C:/ to C:\
@@ -765,7 +765,7 @@ impl Path {
765765
let mut s = String::from_str(s.slice_to(len));
766766
unsafe {
767767
let v = s.as_mut_vec();
768-
v[4] = (*v)[4].to_ascii().to_uppercase().to_byte();
768+
v[4] = (*v)[4].to_ascii().to_uppercase().as_byte();
769769
}
770770
Some(s)
771771
}
@@ -787,13 +787,13 @@ impl Path {
787787
match prefix {
788788
Some(DiskPrefix) => {
789789
s.push(prefix_.as_bytes()[0].to_ascii()
790-
.to_uppercase().to_char());
790+
.to_uppercase().as_char());
791791
s.push(':');
792792
}
793793
Some(VerbatimDiskPrefix) => {
794794
s.push_str(prefix_.slice_to(4));
795795
s.push(prefix_.as_bytes()[4].to_ascii()
796-
.to_uppercase().to_char());
796+
.to_uppercase().as_char());
797797
s.push_str(prefix_.slice_from(5));
798798
}
799799
Some(UNCPrefix(a,b)) => {

branches/try/src/libterm/terminfo/parm.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,8 @@ fn format(val: Param, op: FormatOp, flags: Flags) -> Result<Vec<u8> ,String> {
535535
FormatHEX => {
536536
s = s.as_slice()
537537
.to_ascii()
538-
.to_uppercase()
539-
.into_bytes()
540-
.into_iter()
538+
.iter()
539+
.map(|b| b.to_uppercase().as_byte())
541540
.collect();
542541
if flags.alternate {
543542
let s_ = replace(&mut s, vec!(b'0', b'X'));

0 commit comments

Comments
 (0)