File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -585,16 +585,17 @@ where
585585impl < ' a , P : Pattern < ' a > > SplitInternal < ' a , P > {
586586 #[ inline]
587587 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 {
589589 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) ;
594595 }
595- } else {
596- None
597596 }
597+
598+ None
598599 }
599600
600601 #[ inline]
You can’t perform that action at this time.
0 commit comments