File tree 1 file changed +5
-13
lines changed
1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -869,24 +869,17 @@ impl FormatString {
869
869
let mut right = String :: new ( ) ;
870
870
871
871
let mut split = false ;
872
+ let mut selected = & mut left;
872
873
let mut inside_brackets = false ;
873
874
874
875
while let Some ( char) = chars. next ( ) {
875
876
if char == '[' {
876
877
inside_brackets = true ;
877
878
878
- if split {
879
- right. push ( char) ;
880
- } else {
881
- left. push ( char) ;
882
- }
879
+ selected. push ( char) ;
883
880
884
881
while let Some ( next_char) = chars. next ( ) {
885
- if split {
886
- right. push ( next_char) ;
887
- } else {
888
- left. push ( next_char) ;
889
- }
882
+ selected. push ( next_char) ;
890
883
891
884
if next_char == ']' {
892
885
inside_brackets = false ;
@@ -898,10 +891,9 @@ impl FormatString {
898
891
}
899
892
} else if char == ':' && !split && !inside_brackets {
900
893
split = true ;
901
- } else if split {
902
- right. push ( char) ;
894
+ selected = & mut right;
903
895
} else {
904
- left . push ( char) ;
896
+ selected . push ( char) ;
905
897
}
906
898
}
907
899
You can’t perform that action at this time.
0 commit comments