Skip to content

Commit 2e8a839

Browse files
committed
stdlib: Rename the 'ls_' param in list functions to 'ls'
1 parent 1da99cd commit 2e8a839

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/lib/list.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ and so on, returning the accumulated result.
4040
4141
Parameters:
4242
43-
ls_ - The list to fold
43+
ls - The list to fold
4444
u - The initial value
4545
f - The function to apply
4646
*/
47-
fn foldl<T, U>(ls_: list<T>, u: U, f: block(T, U) -> U) -> U {
47+
fn foldl<T, U>(ls: list<T>, u: U, f: block(T, U) -> U) -> U {
4848
let accum: U = u;
49-
let ls = ls_;
49+
let ls = ls;
5050
while true {
5151
alt ls {
5252
cons(hd, tl) { accum = f(hd, accum); ls = *tl; }
@@ -65,8 +65,8 @@ Apply function `f` to each element of `v`, starting from the first.
6565
When function `f` returns true then an option containing the element
6666
is returned. If `f` matches no elements then none is returned.
6767
*/
68-
fn find<T, U>(ls_: list<T>, f: block(T) -> option::t<U>) -> option::t<U> {
69-
let ls = ls_;
68+
fn find<T, U>(ls: list<T>, f: block(T) -> option::t<U>) -> option::t<U> {
69+
let ls = ls;
7070
while true {
7171
alt ls {
7272
cons(hd, tl) {
@@ -83,8 +83,8 @@ Function: has
8383
8484
Returns true if a list contains an element with the given value
8585
*/
86-
fn has<T>(ls_: list<T>, elt: T) -> bool {
87-
let ls = ls_;
86+
fn has<T>(ls: list<T>, elt: T) -> bool {
87+
let ls = ls;
8888
while true {
8989
alt ls {
9090
cons(hd, tl) { if elt == hd { ret true; } else { ls = *tl; } }

0 commit comments

Comments
 (0)