Skip to content

Commit

Permalink
core: rename str::lteq to str::le
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaslee authored and marijnh committed Feb 3, 2012
1 parent 633e450 commit 31b0d1b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/comp/middle/ty.rs
Expand Up @@ -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);
}
Expand Down
14 changes: 7 additions & 7 deletions src/libcore/str.rs
Expand Up @@ -54,7 +54,7 @@ export

// Comparing strings
eq,
lteq,
le,
hash,

// Iterating through strings
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"));
}

Expand Down
2 changes: 1 addition & 1 deletion src/libstd/test.rs
Expand Up @@ -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)
};
Expand Down
2 changes: 1 addition & 1 deletion src/rustdoc/sort_pass.rs
Expand Up @@ -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 { }";
Expand Down

0 comments on commit 31b0d1b

Please sign in to comment.