File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -585,16 +585,17 @@ where
585
585
impl < ' a , P : Pattern < ' a > > SplitInternal < ' a , P > {
586
586
#[ inline]
587
587
fn get_end ( & mut self ) -> Option < & ' a str > {
588
- if !self . finished && ( self . allow_trailing_empty || self . end - self . start > 0 ) {
588
+ if !self . finished {
589
589
self . finished = true ;
590
- // SAFETY: `self.start` and `self.end` always lie on unicode boundaries.
591
- unsafe {
592
- let string = self . matcher . haystack ( ) . get_unchecked ( self . start ..self . end ) ;
593
- Some ( string)
590
+
591
+ if self . allow_trailing_empty || self . end - self . start > 0 {
592
+ // SAFETY: `self.start` and `self.end` always lie on unicode boundaries.
593
+ let string = unsafe { self . matcher . haystack ( ) . get_unchecked ( self . start ..self . end ) } ;
594
+ return Some ( string) ;
594
595
}
595
- } else {
596
- None
597
596
}
597
+
598
+ None
598
599
}
599
600
600
601
#[ inline]
You can’t perform that action at this time.
0 commit comments