@@ -199,7 +199,7 @@ impl<'a> Iterator for Decompositions<'a> {
199199 let buffer = & mut self . buffer ;
200200 let sorted = & mut self . sorted ;
201201 {
202- let callback = |& mut : d| {
202+ let callback = |d| {
203203 let class =
204204 unicode:: char:: canonical_combining_class ( d) ;
205205 if class == 0 && !* sorted {
@@ -592,7 +592,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
592592 /// let v: Vec<&str> = "Mary had a little lamb".split(' ').collect();
593593 /// assert_eq!(v, vec!["Mary", "had", "a", "little", "lamb"]);
594594 ///
595- /// let v: Vec<&str> = "abc1def2ghi".split(|&: c: char| c.is_numeric()).collect();
595+ /// let v: Vec<&str> = "abc1def2ghi".split(|c: char| c.is_numeric()).collect();
596596 /// assert_eq!(v, vec!["abc", "def", "ghi"]);
597597 ///
598598 /// let v: Vec<&str> = "lionXXtigerXleopard".split('X').collect();
@@ -616,7 +616,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
616616 /// let v: Vec<&str> = "Mary had a little lambda".splitn(2, ' ').collect();
617617 /// assert_eq!(v, vec!["Mary", "had", "a little lambda"]);
618618 ///
619- /// let v: Vec<&str> = "abc1def2ghi".splitn(1, |&: c: char| c.is_numeric()).collect();
619+ /// let v: Vec<&str> = "abc1def2ghi".splitn(1, |c: char| c.is_numeric()).collect();
620620 /// assert_eq!(v, vec!["abc", "def2ghi"]);
621621 ///
622622 /// let v: Vec<&str> = "lionXXtigerXleopard".splitn(2, 'X').collect();
@@ -651,7 +651,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
651651 /// let v: Vec<&str> = "Mary had a little lamb".split(' ').rev().collect();
652652 /// assert_eq!(v, vec!["lamb", "little", "a", "had", "Mary"]);
653653 ///
654- /// let v: Vec<&str> = "abc1def2ghi".split(|&: c: char| c.is_numeric()).rev().collect();
654+ /// let v: Vec<&str> = "abc1def2ghi".split(|c: char| c.is_numeric()).rev().collect();
655655 /// assert_eq!(v, vec!["ghi", "def", "abc"]);
656656 ///
657657 /// let v: Vec<&str> = "lionXXtigerXleopard".split('X').rev().collect();
@@ -672,7 +672,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
672672 /// let v: Vec<&str> = "Mary had a little lamb".rsplitn(2, ' ').collect();
673673 /// assert_eq!(v, vec!["lamb", "little", "Mary had a"]);
674674 ///
675- /// let v: Vec<&str> = "abc1def2ghi".rsplitn(1, |&: c: char| c.is_numeric()).collect();
675+ /// let v: Vec<&str> = "abc1def2ghi".rsplitn(1, |c: char| c.is_numeric()).collect();
676676 /// assert_eq!(v, vec!["ghi", "abc1def"]);
677677 ///
678678 /// let v: Vec<&str> = "lionXXtigerXleopard".rsplitn(2, 'X').collect();
@@ -853,7 +853,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
853853 /// assert_eq!("11foo1bar11".trim_matches('1'), "foo1bar");
854854 /// let x: &[_] = &['1', '2'];
855855 /// assert_eq!("12foo1bar12".trim_matches(x), "foo1bar");
856- /// assert_eq!("123foo1bar123".trim_matches(|&: c: char| c.is_numeric()), "foo1bar");
856+ /// assert_eq!("123foo1bar123".trim_matches(|c: char| c.is_numeric()), "foo1bar");
857857 /// ```
858858 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
859859 fn trim_matches < P : CharEq > ( & self , pat : P ) -> & str {
@@ -873,7 +873,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
873873 /// assert_eq!("11foo1bar11".trim_left_matches('1'), "foo1bar11");
874874 /// let x: &[_] = &['1', '2'];
875875 /// assert_eq!("12foo1bar12".trim_left_matches(x), "foo1bar12");
876- /// assert_eq!("123foo1bar123".trim_left_matches(|&: c: char| c.is_numeric()), "foo1bar123");
876+ /// assert_eq!("123foo1bar123".trim_left_matches(|c: char| c.is_numeric()), "foo1bar123");
877877 /// ```
878878 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
879879 fn trim_left_matches < P : CharEq > ( & self , pat : P ) -> & str {
@@ -893,7 +893,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
893893 /// assert_eq!("11foo1bar11".trim_right_matches('1'), "11foo1bar");
894894 /// let x: &[_] = &['1', '2'];
895895 /// assert_eq!("12foo1bar12".trim_right_matches(x), "12foo1bar");
896- /// assert_eq!("123foo1bar123".trim_right_matches(|&: c: char| c.is_numeric()), "123foo1bar");
896+ /// assert_eq!("123foo1bar123".trim_right_matches(|c: char| c.is_numeric()), "123foo1bar");
897897 /// ```
898898 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
899899 fn trim_right_matches < P : CharEq > ( & self , pat : P ) -> & str {
@@ -1066,7 +1066,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
10661066 /// assert_eq!(s.find('é'), Some(14));
10671067 ///
10681068 /// // the first space
1069- /// assert_eq!(s.find(|&: c: char| c.is_whitespace()), Some(5));
1069+ /// assert_eq!(s.find(|c: char| c.is_whitespace()), Some(5));
10701070 ///
10711071 /// // neither are found
10721072 /// let x: &[_] = &['1', '2'];
@@ -1094,7 +1094,7 @@ pub trait StrExt: Index<RangeFull, Output = str> {
10941094 /// assert_eq!(s.rfind('é'), Some(14));
10951095 ///
10961096 /// // the second space
1097- /// assert_eq!(s.rfind(|&: c: char| c.is_whitespace()), Some(12));
1097+ /// assert_eq!(s.rfind(|c: char| c.is_whitespace()), Some(12));
10981098 ///
10991099 /// // searches for an occurrence of either `1` or `2`, but neither are found
11001100 /// let x: &[_] = &['1', '2'];
@@ -1387,21 +1387,21 @@ mod tests {
13871387 #[ test]
13881388 fn test_find ( ) {
13891389 assert_eq ! ( "hello" . find( 'l' ) , Some ( 2 u) ) ;
1390- assert_eq ! ( "hello" . find( |& : c: char | c == 'o' ) , Some ( 4 u) ) ;
1390+ assert_eq ! ( "hello" . find( |c: char | c == 'o' ) , Some ( 4 u) ) ;
13911391 assert ! ( "hello" . find( 'x' ) . is_none( ) ) ;
1392- assert ! ( "hello" . find( |& : c: char | c == 'x' ) . is_none( ) ) ;
1392+ assert ! ( "hello" . find( |c: char | c == 'x' ) . is_none( ) ) ;
13931393 assert_eq ! ( "ประเทศไทย中华Việt Nam" . find( '华' ) , Some ( 30 u) ) ;
1394- assert_eq ! ( "ประเทศไทย中华Việt Nam" . find( |& : c: char | c == '华' ) , Some ( 30 u) ) ;
1394+ assert_eq ! ( "ประเทศไทย中华Việt Nam" . find( |c: char | c == '华' ) , Some ( 30 u) ) ;
13951395 }
13961396
13971397 #[ test]
13981398 fn test_rfind ( ) {
13991399 assert_eq ! ( "hello" . rfind( 'l' ) , Some ( 3 u) ) ;
1400- assert_eq ! ( "hello" . rfind( |& : c: char | c == 'o' ) , Some ( 4 u) ) ;
1400+ assert_eq ! ( "hello" . rfind( |c: char | c == 'o' ) , Some ( 4 u) ) ;
14011401 assert ! ( "hello" . rfind( 'x' ) . is_none( ) ) ;
1402- assert ! ( "hello" . rfind( |& : c: char | c == 'x' ) . is_none( ) ) ;
1402+ assert ! ( "hello" . rfind( |c: char | c == 'x' ) . is_none( ) ) ;
14031403 assert_eq ! ( "ประเทศไทย中华Việt Nam" . rfind( '华' ) , Some ( 30 u) ) ;
1404- assert_eq ! ( "ประเทศไทย中华Việt Nam" . rfind( |& : c: char | c == '华' ) , Some ( 30 u) ) ;
1404+ assert_eq ! ( "ประเทศไทย中华Việt Nam" . rfind( |c: char | c == '华' ) , Some ( 30 u) ) ;
14051405 }
14061406
14071407 #[ test]
@@ -1723,7 +1723,7 @@ mod tests {
17231723 assert_eq ! ( "11foo1bar11" . trim_left_matches( '1' ) , "foo1bar11" ) ;
17241724 let chars: & [ char ] = & [ '1' , '2' ] ;
17251725 assert_eq ! ( "12foo1bar12" . trim_left_matches( chars) , "foo1bar12" ) ;
1726- assert_eq ! ( "123foo1bar123" . trim_left_matches( |& : c: char | c. is_numeric( ) ) , "foo1bar123" ) ;
1726+ assert_eq ! ( "123foo1bar123" . trim_left_matches( |c: char | c. is_numeric( ) ) , "foo1bar123" ) ;
17271727 }
17281728
17291729 #[ test]
@@ -1738,7 +1738,7 @@ mod tests {
17381738 assert_eq ! ( "11foo1bar11" . trim_right_matches( '1' ) , "11foo1bar" ) ;
17391739 let chars: & [ char ] = & [ '1' , '2' ] ;
17401740 assert_eq ! ( "12foo1bar12" . trim_right_matches( chars) , "12foo1bar" ) ;
1741- assert_eq ! ( "123foo1bar123" . trim_right_matches( |& : c: char | c. is_numeric( ) ) , "123foo1bar" ) ;
1741+ assert_eq ! ( "123foo1bar123" . trim_right_matches( |c: char | c. is_numeric( ) ) , "123foo1bar" ) ;
17421742 }
17431743
17441744 #[ test]
@@ -1753,7 +1753,7 @@ mod tests {
17531753 assert_eq ! ( "11foo1bar11" . trim_matches( '1' ) , "foo1bar" ) ;
17541754 let chars: & [ char ] = & [ '1' , '2' ] ;
17551755 assert_eq ! ( "12foo1bar12" . trim_matches( chars) , "foo1bar" ) ;
1756- assert_eq ! ( "123foo1bar123" . trim_matches( |& : c: char | c. is_numeric( ) ) , "foo1bar" ) ;
1756+ assert_eq ! ( "123foo1bar123" . trim_matches( |c: char | c. is_numeric( ) ) , "foo1bar" ) ;
17571757 }
17581758
17591759 #[ test]
@@ -2222,14 +2222,14 @@ mod tests {
22222222 let split: Vec < & str > = data. splitn ( 3 , ' ' ) . collect ( ) ;
22232223 assert_eq ! ( split, vec![ "\n Märy" , "häd" , "ä" , "little lämb\n Little lämb\n " ] ) ;
22242224
2225- let split: Vec < & str > = data. splitn ( 3 , |& : c: char | c == ' ' ) . collect ( ) ;
2225+ let split: Vec < & str > = data. splitn ( 3 , |c : char | c == ' ' ) . collect ( ) ;
22262226 assert_eq ! ( split, vec![ "\n Märy" , "häd" , "ä" , "little lämb\n Little lämb\n " ] ) ;
22272227
22282228 // Unicode
22292229 let split: Vec < & str > = data. splitn ( 3 , 'ä' ) . collect ( ) ;
22302230 assert_eq ! ( split, vec![ "\n M" , "ry h" , "d " , " little lämb\n Little lämb\n " ] ) ;
22312231
2232- let split: Vec < & str > = data. splitn ( 3 , |& : c: char | c == 'ä' ) . collect ( ) ;
2232+ let split: Vec < & str > = data. splitn ( 3 , |c : char | c == 'ä' ) . collect ( ) ;
22332233 assert_eq ! ( split, vec![ "\n M" , "ry h" , "d " , " little lämb\n Little lämb\n " ] ) ;
22342234 }
22352235
@@ -2940,7 +2940,7 @@ mod bench {
29402940 let s = "Mary had a little lamb, Little lamb, little-lamb." ;
29412941 let len = s. split ( ' ' ) . count ( ) ;
29422942
2943- b. iter ( || assert_eq ! ( s. split( |& : c: char | c == ' ' ) . count( ) , len) ) ;
2943+ b. iter ( || assert_eq ! ( s. split( |c: char | c == ' ' ) . count( ) , len) ) ;
29442944 }
29452945
29462946 #[ bench]
0 commit comments