about summary refs log tree commit diff
path: root/library/core/src
diff options
context:
space:
mode:
Diffstat (limited to 'library/core/src')
-rw-r--r--library/core/src/fmt/builders.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/library/core/src/fmt/builders.rs b/library/core/src/fmt/builders.rs
index b660788c051..8e7b03d02f1 100644
--- a/library/core/src/fmt/builders.rs
+++ b/library/core/src/fmt/builders.rs
@@ -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 }))
     }
 }