]> git.lizzy.rs Git - rust.git/commitdiff
stdlib: Rename the 'ls_' param in list functions to 'ls'
authorBrian Anderson <banderson@mozilla.com>
Fri, 28 Oct 2011 20:34:17 +0000 (13:34 -0700)
committerBrian Anderson <banderson@mozilla.com>
Fri, 28 Oct 2011 20:34:17 +0000 (13:34 -0700)
src/lib/list.rs

index f1851a2564ea9c485fd3c1c30d1af81018c08242..2b22fb97c8e6779f450bdb27e9eb1794d7ed55c2 100644 (file)
@@ -40,13 +40,13 @@ fn from_vec<T>(v: [mutable? T]) -> list<T> {
 
 Parameters:
 
-ls_ - The list to fold
+ls - The list to fold
 u - The initial value
 f - The function to apply
 */
-fn foldl<T, U>(ls_: list<T>, u: U, f: block(T, U) -> U) -> U {
+fn foldl<T, U>(ls: list<T>, u: U, f: block(T, U) -> U) -> U {
     let accum: U = u;
-    let ls = ls_;
+    let ls = ls;
     while true {
         alt ls {
           cons(hd, tl) { accum = f(hd, accum); ls = *tl; }
@@ -65,8 +65,8 @@ fn foldl<T, U>(ls_: list<T>, u: U, f: block(T, U) -> U) -> U {
 When function `f` returns true then an option containing the element
 is returned. If `f` matches no elements then none is returned.
 */
-fn find<T, U>(ls_: list<T>, f: block(T) -> option::t<U>) -> option::t<U> {
-    let ls = ls_;
+fn find<T, U>(ls: list<T>, f: block(T) -> option::t<U>) -> option::t<U> {
+    let ls = ls;
     while true {
         alt ls {
           cons(hd, tl) {
@@ -83,8 +83,8 @@ fn find<T, U>(ls_: list<T>, f: block(T) -> option::t<U>) -> option::t<U> {
 
 Returns true if a list contains an element with the given value
 */
-fn has<T>(ls_: list<T>, elt: T) -> bool {
-    let ls = ls_;
+fn has<T>(ls: list<T>, elt: T) -> bool {
+    let ls = ls;
     while true {
         alt ls {
           cons(hd, tl) { if elt == hd { ret true; } else { ls = *tl; } }