mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
Rollup merge of #94363 - aDotInTheVoid:fmt-needless-borrows, r=scottmcm
Remove needless borrows from core::fmt
This commit is contained in:
commit
0c9d5e3c77
@ -138,7 +138,7 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
|
||||
}
|
||||
let mut slot = None;
|
||||
let mut state = Default::default();
|
||||
let mut writer = PadAdapter::wrap(&mut self.fmt, &mut slot, &mut state);
|
||||
let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut state);
|
||||
writer.write_str(name)?;
|
||||
writer.write_str(": ")?;
|
||||
value.fmt(&mut writer)?;
|
||||
@ -189,7 +189,7 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
|
||||
if self.is_pretty() {
|
||||
let mut slot = None;
|
||||
let mut state = Default::default();
|
||||
let mut writer = PadAdapter::wrap(&mut self.fmt, &mut slot, &mut state);
|
||||
let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut state);
|
||||
writer.write_str("..\n")?;
|
||||
self.fmt.write_str("}")
|
||||
} else {
|
||||
@ -323,7 +323,7 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
|
||||
}
|
||||
let mut slot = None;
|
||||
let mut state = Default::default();
|
||||
let mut writer = PadAdapter::wrap(&mut self.fmt, &mut slot, &mut state);
|
||||
let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut state);
|
||||
value.fmt(&mut writer)?;
|
||||
writer.write_str(",\n")
|
||||
} else {
|
||||
@ -394,7 +394,7 @@ impl<'a, 'b: 'a> DebugInner<'a, 'b> {
|
||||
}
|
||||
let mut slot = None;
|
||||
let mut state = Default::default();
|
||||
let mut writer = PadAdapter::wrap(&mut self.fmt, &mut slot, &mut state);
|
||||
let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut state);
|
||||
entry.fmt(&mut writer)?;
|
||||
writer.write_str(",\n")
|
||||
} else {
|
||||
@ -789,7 +789,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
|
||||
}
|
||||
let mut slot = None;
|
||||
self.state = Default::default();
|
||||
let mut writer = PadAdapter::wrap(&mut self.fmt, &mut slot, &mut self.state);
|
||||
let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut self.state);
|
||||
key.fmt(&mut writer)?;
|
||||
writer.write_str(": ")?;
|
||||
} else {
|
||||
@ -845,7 +845,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
|
||||
|
||||
if self.is_pretty() {
|
||||
let mut slot = None;
|
||||
let mut writer = PadAdapter::wrap(&mut self.fmt, &mut slot, &mut self.state);
|
||||
let mut writer = PadAdapter::wrap(self.fmt, &mut slot, &mut self.state);
|
||||
value.fmt(&mut writer)?;
|
||||
writer.write_str(",\n")?;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user