@@ -2551,7 +2551,7 @@ impl StrExt for str {
2551
2551
2552
2552
#[ inline]
2553
2553
fn split_whitespace ( & self ) -> SplitWhitespace {
2554
- SplitWhitespace { inner : self . split ( IsWhitespace ) . filter ( IsNotEmpty ) }
2554
+ SplitWhitespace { inner : self . split_terminator ( IsWhitespace ) }
2555
2555
}
2556
2556
2557
2557
#[ inline]
@@ -2605,7 +2605,7 @@ impl<'a> Default for &'a str {
2605
2605
#[ stable( feature = "split_whitespace" , since = "1.1.0" ) ]
2606
2606
#[ derive( Clone , Debug ) ]
2607
2607
pub struct SplitWhitespace < ' a > {
2608
- inner : Filter < Split < ' a , IsWhitespace > , IsNotEmpty > ,
2608
+ inner : SplitTerminator < ' a , IsWhitespace > >,
2609
2609
}
2610
2610
2611
2611
#[ derive( Clone ) ]
@@ -2627,25 +2627,6 @@ impl FnMut<(char, )> for IsWhitespace {
2627
2627
}
2628
2628
}
2629
2629
2630
- #[ derive( Clone ) ]
2631
- struct IsNotEmpty ;
2632
-
2633
- impl < ' a , ' b > FnOnce < ( & ' a & ' b str , ) > for IsNotEmpty {
2634
- type Output = bool ;
2635
-
2636
- #[ inline]
2637
- extern "rust-call" fn call_once ( mut self , arg : ( & & str , ) ) -> bool {
2638
- self . call_mut ( arg)
2639
- }
2640
- }
2641
-
2642
- impl < ' a , ' b > FnMut < ( & ' a & ' b str , ) > for IsNotEmpty {
2643
- #[ inline]
2644
- extern "rust-call" fn call_mut ( & mut self , arg : ( & & str , ) ) -> bool {
2645
- !arg. 0 . is_empty ( )
2646
- }
2647
- }
2648
-
2649
2630
2650
2631
#[ stable( feature = "split_whitespace" , since = "1.1.0" ) ]
2651
2632
impl < ' a > Iterator for SplitWhitespace < ' a > {
0 commit comments