@@ -376,7 +376,7 @@ Iterate over the characters in a string
376
376
377
377
FIXME: A synonym to iter_chars
378
378
*/
379
- fn chars_iter ( ss : str , it : fn & ( char ) ) {
379
+ fn chars_iter ( ss : str , it : fn ( char ) ) {
380
380
iter_chars ( ss, it)
381
381
}
382
382
@@ -387,7 +387,7 @@ Iterate over the bytes in a string
387
387
388
388
FIXME: Should it really include the last byte '\0'?
389
389
*/
390
- fn bytes_iter ( ss : str , it : fn & ( u8 ) ) {
390
+ fn bytes_iter ( ss : str , it : fn ( u8 ) ) {
391
391
let pos = 0 u;
392
392
let len = byte_len ( ss) ;
393
393
@@ -866,7 +866,7 @@ Splits a string into substrings using a function
866
866
867
867
FIXME: will be renamed to split.
868
868
*/
869
- fn split_func ( ss : str , sepfn : fn & ( cc : char ) ->bool ) -> [ str ] {
869
+ fn split_func ( ss : str , sepfn : fn ( cc : char ) ->bool ) -> [ str ] {
870
870
let vv: [ str ] = [ ] ;
871
871
let accum: str = "" ;
872
872
let ends_with_sep: bool = false ;
@@ -933,7 +933,7 @@ Function: words_iter
933
933
934
934
Apply a function to each word
935
935
*/
936
- fn words_iter ( ss : str , ff : fn & ( & & str ) ) {
936
+ fn words_iter ( ss : str , ff : fn ( & & str ) ) {
937
937
vec:: iter ( words ( ss) , ff)
938
938
}
939
939
@@ -942,7 +942,7 @@ Function: lines_iter
942
942
943
943
Apply a function to each lines (by '\n')
944
944
*/
945
- fn lines_iter ( ss : str , ff : fn & ( & & str ) ) {
945
+ fn lines_iter ( ss : str , ff : fn ( & & str ) ) {
946
946
vec:: iter ( lines ( ss) , ff)
947
947
}
948
948
@@ -1180,7 +1180,7 @@ if the string contains no characters
1180
1180
1181
1181
// FIXME: a synonym to loop_chars
1182
1182
*/
1183
- fn all ( ss : str , ff : fn & ( char ) -> bool ) -> bool {
1183
+ fn all ( ss : str , ff : fn ( char ) -> bool ) -> bool {
1184
1184
str:: loop_chars ( ss, ff)
1185
1185
}
1186
1186
@@ -1190,7 +1190,7 @@ Function: any
1190
1190
Return true if a predicate matches any character
1191
1191
(and false if it matches none or there are no characters)
1192
1192
*/
1193
- fn any ( ss : str , pred : fn & ( char ) -> bool ) -> bool {
1193
+ fn any ( ss : str , pred : fn ( char ) -> bool ) -> bool {
1194
1194
!all ( ss, { |cc| !pred ( cc) } )
1195
1195
}
1196
1196
@@ -1199,7 +1199,7 @@ Function: map
1199
1199
1200
1200
Apply a function to each character
1201
1201
*/
1202
- fn map ( ss : str , ff : fn & ( char ) -> char ) -> str {
1202
+ fn map ( ss : str , ff : fn ( char ) -> char ) -> str {
1203
1203
let result = "" ;
1204
1204
1205
1205
str:: iter_chars ( ss, { |cc|
0 commit comments