File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -158,21 +158,21 @@ impl FormatSpec {
158158
159159 match self . align . unwrap_or ( '>' ) {
160160 '<' => {
161- formatted. extend ( std:: iter:: repeat ( fill_char) . take ( padding) ) ;
161+ formatted. extend ( std:: iter:: repeat_n ( fill_char, padding) ) ;
162162 }
163163 '>' => {
164164 let mut new_string = String :: new ( ) ;
165- new_string. extend ( std:: iter:: repeat ( fill_char) . take ( padding) ) ;
165+ new_string. extend ( std:: iter:: repeat_n ( fill_char, padding) ) ;
166166 new_string. push_str ( & formatted) ;
167167 formatted = new_string;
168168 }
169169 '^' => {
170170 let left_pad = padding / 2 ;
171171 let right_pad = padding - left_pad;
172172 let mut new_string = String :: new ( ) ;
173- new_string. extend ( std:: iter:: repeat ( fill_char) . take ( left_pad) ) ;
173+ new_string. extend ( std:: iter:: repeat_n ( fill_char, left_pad) ) ;
174174 new_string. push_str ( & formatted) ;
175- new_string. extend ( std:: iter:: repeat ( fill_char) . take ( right_pad) ) ;
175+ new_string. extend ( std:: iter:: repeat_n ( fill_char, right_pad) ) ;
176176 formatted = new_string;
177177 }
178178 _ => unreachable ! ( ) ,
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ impl<'gc> State<'gc> {
166166
167167 pub fn import_module ( & mut self , path : InternedString < ' gc > ) -> Result < ( ) , VmError > {
168168 // Get the simple name (last component) from the path
169- let simple_name = path. to_str ( ) . unwrap ( ) . split ( '.' ) . last ( ) . unwrap ( ) ;
169+ let simple_name = path. to_str ( ) . unwrap ( ) . split ( '.' ) . next_back ( ) . unwrap ( ) ;
170170 let simple_name = self . intern ( simple_name. as_bytes ( ) ) ;
171171
172172 // Check if simple name is already used
You can’t perform that action at this time.
0 commit comments