diff options
| author | Marvin Löbel <loebel.marvin@gmail.com> | 2013-04-23 11:08:13 +0200 |
|---|---|---|
| committer | Marvin Löbel <loebel.marvin@gmail.com> | 2013-04-24 22:26:09 +0200 |
| commit | dd748079574197215da46ac164f16a392df9cc26 (patch) | |
| tree | dc080a272f782c967a375056d48de94eb48be56b /src/libstd | |
| parent | e26f992d5e199a1ff8c26733650d254d63be066a (diff) | |
| download | rust-dd748079574197215da46ac164f16a392df9cc26.tar.gz rust-dd748079574197215da46ac164f16a392df9cc26.zip | |
Removed ascii functions from other modules
Replaced str::to_lowercase and str::to_uppercase
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/semver.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sort.rs | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/libstd/semver.rs b/src/libstd/semver.rs index 83fab365d8d..f6d1b1ba2ec 100644 --- a/src/libstd/semver.rs +++ b/src/libstd/semver.rs @@ -220,7 +220,7 @@ fn parse_reader(rdr: @io::Reader) -> Version { pub fn parse(s: &str) -> Option<Version> { - if ! str::is_ascii(s) { + if !s.is_ascii() { return None; } let s = s.trim(); diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs index db6efdf3f52..8be3e1e6a62 100644 --- a/src/libstd/sort.rs +++ b/src/libstd/sort.rs @@ -885,8 +885,12 @@ mod tests { // tjc: funny that we have to use parens fn ile(x: &(&'static str), y: &(&'static str)) -> bool { - let x = x.to_lower(); - let y = y.to_lower(); + // FIXME: 4318 Instead of to_str_ascii, could use + // to_str_consume to not do a unneccessary copy. + // (Actually, could just remove the to_str_* call, but needs an deriving(Ord) on + // Ascii) + let x = x.to_ascii().to_lower().to_str_ascii(); + let y = y.to_ascii().to_lower().to_str_ascii(); x <= y } |
