core: rename str::lteq to str::le
This commit is contained in:
parent
633e4502e7
commit
31b0d1b4bd
4 changed files with 10 additions and 10 deletions
|
@ -1588,7 +1588,7 @@ fn method_idx(id: ast::ident, meths: [method]) -> option<uint> {
|
||||||
|
|
||||||
fn sort_methods(meths: [method]) -> [method] {
|
fn sort_methods(meths: [method]) -> [method] {
|
||||||
fn method_lteq(a: method, b: method) -> bool {
|
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);
|
ret std::sort::merge_sort(bind method_lteq(_, _), meths);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ export
|
||||||
|
|
||||||
// Comparing strings
|
// Comparing strings
|
||||||
eq,
|
eq,
|
||||||
lteq,
|
le,
|
||||||
hash,
|
hash,
|
||||||
|
|
||||||
// Iterating through strings
|
// Iterating through strings
|
||||||
|
@ -704,11 +704,11 @@ Bytewise string equality
|
||||||
pure fn eq(&&a: str, &&b: str) -> bool { a == b }
|
pure fn eq(&&a: str, &&b: str) -> bool { a == b }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Function: lteq
|
Function: le
|
||||||
|
|
||||||
Bytewise less than or equal
|
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
|
Function: hash
|
||||||
|
@ -1381,10 +1381,10 @@ mod tests {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_lteq() {
|
fn test_le() {
|
||||||
assert (lteq("", ""));
|
assert (le("", ""));
|
||||||
assert (lteq("", "foo"));
|
assert (le("", "foo"));
|
||||||
assert (lteq("foo", "foo"));
|
assert (le("foo", "foo"));
|
||||||
assert (!eq("foo", "bar"));
|
assert (!eq("foo", "bar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ fn filter_tests(opts: test_opts,
|
||||||
filtered =
|
filtered =
|
||||||
{
|
{
|
||||||
fn lteq(t1: test_desc, t2: test_desc) -> bool {
|
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)
|
sort::merge_sort(bind lteq(_, _), filtered)
|
||||||
};
|
};
|
||||||
|
|
|
@ -38,7 +38,7 @@ fn fold_mod(
|
||||||
#[test]
|
#[test]
|
||||||
fn test() {
|
fn test() {
|
||||||
fn name_lteq(item1: doc::itemtag, item2: doc::itemtag) -> bool {
|
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 { }";
|
let source = "mod z { mod y { } fn x() { } } mod w { }";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue