diff options
| author | Tom Lee <github@tomlee.co> | 2012-02-03 03:28:49 -0800 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2012-02-03 14:09:44 +0100 |
| commit | 31b0d1b4bdf47554604bd4962d8d940c5e29cc7a (patch) | |
| tree | b80e7ed47a9ab5823704669cc4a1133e1a9a01ad | |
| parent | 633e4502e76811183208b5d1e107c4ccde2ce36c (diff) | |
| download | rust-31b0d1b4bdf47554604bd4962d8d940c5e29cc7a.tar.gz rust-31b0d1b4bdf47554604bd4962d8d940c5e29cc7a.zip | |
core: rename str::lteq to str::le
| -rw-r--r-- | src/comp/middle/ty.rs | 2 | ||||
| -rw-r--r-- | src/libcore/str.rs | 14 | ||||
| -rw-r--r-- | src/libstd/test.rs | 2 | ||||
| -rw-r--r-- | src/rustdoc/sort_pass.rs | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index 96ef2d60bc5..9c507d296c6 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -1588,7 +1588,7 @@ fn method_idx(id: ast::ident, meths: [method]) -> option<uint> { fn sort_methods(meths: [method]) -> [method] { fn method_lteq(a: method, b: method) -> bool { - ret str::lteq(a.ident, b.ident); + ret str::le(a.ident, b.ident); } ret std::sort::merge_sort(bind method_lteq(_, _), meths); } diff --git a/src/libcore/str.rs b/src/libcore/str.rs index f632e58eea7..aaf10365983 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -54,7 +54,7 @@ export // Comparing strings eq, - lteq, + le, hash, // Iterating through strings @@ -704,11 +704,11 @@ Bytewise string equality pure fn eq(&&a: str, &&b: str) -> bool { a == b } /* -Function: lteq +Function: le Bytewise less than or equal */ -pure fn lteq(&&a: str, &&b: str) -> bool { a <= b } +pure fn le(&&a: str, &&b: str) -> bool { a <= b } /* Function: hash @@ -1381,10 +1381,10 @@ mod tests { } #[test] - fn test_lteq() { - assert (lteq("", "")); - assert (lteq("", "foo")); - assert (lteq("foo", "foo")); + fn test_le() { + assert (le("", "")); + assert (le("", "foo")); + assert (le("foo", "foo")); assert (!eq("foo", "bar")); } diff --git a/src/libstd/test.rs b/src/libstd/test.rs index 072850a6a65..6d7273ff0b1 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -279,7 +279,7 @@ fn filter_tests(opts: test_opts, filtered = { fn lteq(t1: test_desc, t2: test_desc) -> bool { - str::lteq(t1.name, t2.name) + str::le(t1.name, t2.name) } sort::merge_sort(bind lteq(_, _), filtered) }; diff --git a/src/rustdoc/sort_pass.rs b/src/rustdoc/sort_pass.rs index 01432869ea6..674b028d0d5 100644 --- a/src/rustdoc/sort_pass.rs +++ b/src/rustdoc/sort_pass.rs @@ -38,7 +38,7 @@ fn fold_mod( #[test] fn test() { fn name_lteq(item1: doc::itemtag, item2: doc::itemtag) -> bool { - str::lteq(item1.name(), item2.name()) + str::le(item1.name(), item2.name()) } let source = "mod z { mod y { } fn x() { } } mod w { }"; |
