File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -87,12 +87,11 @@ pub(crate) fn report(error: impl StdError) -> impl Display {
87
87
88
88
impl < E : StdError > Display for Report < E > {
89
89
fn fmt ( & self , formatter : & mut fmt:: Formatter ) -> fmt:: Result {
90
- Display :: fmt ( & self . 0 , formatter ) ?;
90
+ write ! ( formatter , "{}" , self . 0 ) ?;
91
91
let mut error: & dyn StdError = & self . 0 ;
92
92
93
93
while let Some ( cause) = error. source ( ) {
94
- formatter. write_str ( "\n \n Caused by:\n " ) ?;
95
- Display :: fmt ( cause, formatter) ?;
94
+ write ! ( formatter, "\n \n Caused by:\n {}" , cause) ?;
96
95
error = cause;
97
96
}
98
97
Original file line number Diff line number Diff line change @@ -308,9 +308,8 @@ struct CxxName<'a>(&'a Pair);
308
308
impl < ' a > Display for CxxName < ' a > {
309
309
fn fmt ( & self , formatter : & mut fmt:: Formatter ) -> fmt:: Result {
310
310
for namespace in & self . 0 . namespace {
311
- Display :: fmt ( namespace, formatter) ?;
312
- formatter. write_str ( "::" ) ?;
311
+ write ! ( formatter, "{}::" , namespace) ?;
313
312
}
314
- Display :: fmt ( & self . 0 . cxx , formatter )
313
+ write ! ( formatter , "{}" , self . 0 . cxx)
315
314
}
316
315
}
Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ impl Display for Discriminant {
208
208
if self . sign == Sign :: Negative {
209
209
f. write_str ( "-" ) ?;
210
210
}
211
- Display :: fmt ( & self . magnitude , f )
211
+ write ! ( f , "{}" , self . magnitude)
212
212
}
213
213
}
214
214
You can’t perform that action at this time.
0 commit comments