File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1104,7 +1104,9 @@ pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
11041104 None => {
11051105 // We can use default formatting parameters for all arguments.
11061106 for ( arg, piece) in iter:: zip ( args. args , args. pieces ) {
1107- formatter. buf . write_str ( * piece) ?;
1107+ if !piece. is_empty ( ) {
1108+ formatter. buf . write_str ( * piece) ?;
1109+ }
11081110 ( arg. formatter ) ( arg. value , & mut formatter) ?;
11091111 idx += 1 ;
11101112 }
@@ -1113,7 +1115,9 @@ pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
11131115 // Every spec has a corresponding argument that is preceded by
11141116 // a string piece.
11151117 for ( arg, piece) in iter:: zip ( fmt, args. pieces ) {
1116- formatter. buf . write_str ( * piece) ?;
1118+ if !piece. is_empty ( ) {
1119+ formatter. buf . write_str ( * piece) ?;
1120+ }
11171121 // SAFETY: arg and args.args come from the same Arguments,
11181122 // which guarantees the indexes are always within bounds.
11191123 unsafe { run ( & mut formatter, arg, & args. args ) } ?;
You can’t perform that action at this time.
0 commit comments