File tree 1 file changed +6
-2
lines changed
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 {
1104
1104
None => {
1105
1105
// We can use default formatting parameters for all arguments.
1106
1106
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
+ }
1108
1110
( arg. formatter ) ( arg. value , & mut formatter) ?;
1109
1111
idx += 1 ;
1110
1112
}
@@ -1113,7 +1115,9 @@ pub fn write(output: &mut dyn Write, args: Arguments<'_>) -> Result {
1113
1115
// Every spec has a corresponding argument that is preceded by
1114
1116
// a string piece.
1115
1117
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
+ }
1117
1121
// SAFETY: arg and args.args come from the same Arguments,
1118
1122
// which guarantees the indexes are always within bounds.
1119
1123
unsafe { run ( & mut formatter, arg, & args. args ) } ?;
You can’t perform that action at this time.
0 commit comments