File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -869,24 +869,17 @@ impl FormatString {
869869        let  mut  right = String :: new ( ) ; 
870870
871871        let  mut  split = false ; 
872+         let  mut  selected = & mut  left; 
872873        let  mut  inside_brackets = false ; 
873874
874875        while  let  Some ( char)  = chars. next ( )  { 
875876            if  char == '['  { 
876877                inside_brackets = true ; 
877878
878-                 if  split { 
879-                     right. push ( char) ; 
880-                 }  else  { 
881-                     left. push ( char) ; 
882-                 } 
879+                 selected. push ( char) ; 
883880
884881                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) ; 
890883
891884                    if  next_char == ']'  { 
892885                        inside_brackets = false ; 
@@ -898,10 +891,9 @@ impl FormatString {
898891                } 
899892            }  else  if  char == ':'  && !split && !inside_brackets { 
900893                split = true ; 
901-             }  else  if  split { 
902-                 right. push ( char) ; 
894+                 selected = & mut  right; 
903895            }  else  { 
904-                 left . push ( char) ; 
896+                 selected . push ( char) ; 
905897            } 
906898        } 
907899
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments