Optimize fmt::PadAdapter::wrap
This commit is contained in:
parent
99f8efec46
commit
3e82dca65c
1 changed files with 1 additions and 4 deletions
|
@ -23,10 +23,7 @@ impl<'buf, 'state> PadAdapter<'buf, 'state> {
|
|||
slot: &'slot mut Option<Self>,
|
||||
state: &'state mut PadAdapterState,
|
||||
) -> fmt::Formatter<'slot> {
|
||||
fmt.wrap_buf(move |buf| {
|
||||
*slot = Some(PadAdapter { buf, state });
|
||||
slot.as_mut().unwrap()
|
||||
})
|
||||
fmt.wrap_buf(move |buf| slot.insert(PadAdapter { buf, state }))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue