We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e8a839 commit 49e8ffaCopy full SHA for 49e8ffa
src/lib/list.rs
@@ -95,11 +95,11 @@ fn has<T>(ls: list<T>, elt: T) -> bool {
95
}
96
97
/*
98
-Function: length
+Function: len
99
100
Returns the length of a list
101
*/
102
-fn length<T>(ls: list<T>) -> uint {
+fn len<T>(ls: list<T>) -> uint {
103
fn count<T>(_t: T, &&u: uint) -> uint { ret u + 1u; }
104
ret foldl(ls, 0u, bind count(_, _));
105
src/test/stdtest/list.rs
@@ -59,8 +59,8 @@ fn test_has() {
59
60
61
#[test]
62
-fn test_length() {
+fn test_len() {
63
let l = from_vec([0, 1, 2]);
64
- assert (list::length(l) == 3u);
+ assert (list::len(l) == 3u);
65
66
0 commit comments