diff --git a/src/lib/list.rs b/src/lib/list.rs index 2b22fb97c8e..955ba5fda5c 100644 --- a/src/lib/list.rs +++ b/src/lib/list.rs @@ -95,11 +95,11 @@ fn has(ls: list, elt: T) -> bool { } /* -Function: length +Function: len Returns the length of a list */ -fn length(ls: list) -> uint { +fn len(ls: list) -> uint { fn count(_t: T, &&u: uint) -> uint { ret u + 1u; } ret foldl(ls, 0u, bind count(_, _)); } diff --git a/src/test/stdtest/list.rs b/src/test/stdtest/list.rs index 0bfbcbe68a4..980f0535e7a 100644 --- a/src/test/stdtest/list.rs +++ b/src/test/stdtest/list.rs @@ -59,8 +59,8 @@ fn test_has() { } #[test] -fn test_length() { +fn test_len() { let l = from_vec([0, 1, 2]); - assert (list::length(l) == 3u); + assert (list::len(l) == 3u); }