Skip to content

core: rename str::lteq to str::le #1747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/comp/middle/ty.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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