File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -402,7 +402,7 @@ impl<'a> Arguments<'a> {
402402
403403 if self . args . is_empty ( ) {
404404 pieces_length
405- } else if self . pieces [ 0 ] == "" && pieces_length < 16 {
405+ } else if ! self . pieces . is_empty ( ) && self . pieces [ 0 ] . is_empty ( ) && pieces_length < 16 {
406406 // If the format string starts with an argument,
407407 // don't preallocate anything, unless length
408408 // of pieces is significant.
@@ -1163,7 +1163,7 @@ pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
11631163 }
11641164 // SAFETY: arg and args.args come from the same Arguments,
11651165 // which guarantees the indexes are always within bounds.
1166- unsafe { run ( & mut formatter, arg, & args. args ) } ?;
1166+ unsafe { run ( & mut formatter, arg, args. args ) } ?;
11671167 idx += 1 ;
11681168 }
11691169 }
@@ -1409,7 +1409,7 @@ impl<'a> Formatter<'a> {
14091409 // we know that it can't panic. Use `get` + `unwrap_or` to avoid
14101410 // `unsafe` and otherwise don't emit any panic-related code
14111411 // here.
1412- s. get ( ..i) . unwrap_or ( & s)
1412+ s. get ( ..i) . unwrap_or ( s)
14131413 } else {
14141414 & s
14151415 }
You can’t perform that action at this time.
0 commit comments