about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
authorLena Wildervanck <Lena.Wildervanck@gmail.com>2020-03-11 17:30:04 +0100
committerLena Wildervanck <Lena.Wildervanck@gmail.com>2020-03-11 17:30:04 +0100
commit599cd683eac7fdb076fe86f2928062e087214a22 (patch)
tree4497d661a95d5a54d5420710d3e49affc1501ece /src/liballoc
parent88f8b881606aa22fdaabcefbf88ddc163e41d8e6 (diff)
downloadrust-599cd683eac7fdb076fe86f2928062e087214a22.tar.gz
rust-599cd683eac7fdb076fe86f2928062e087214a22.zip
Format the match statement
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/collections/mod.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/liballoc/collections/mod.rs b/src/liballoc/collections/mod.rs
index 9e7e66e657a..b2e9b89cbda 100644
--- a/src/liballoc/collections/mod.rs
+++ b/src/liballoc/collections/mod.rs
@@ -85,12 +85,15 @@ impl Display for TryReserveError {
         fmt: &mut core::fmt::Formatter<'_>,
     ) -> core::result::Result<(), core::fmt::Error> {
         fmt.write_str("memory allocation failed")?;
-        fmt.write_str(match &self {
+        let reason = match &self {
             TryReserveError::CapacityOverflow => {
                 " because the computed capacity exceeded the collection's maximum"
             }
-            TryReserveError::AllocError { .. } => " because the memory allocator returned a error",
-        })
+            TryReserveError::AllocError { .. } => {
+                " because the memory allocator returned a error"
+            }
+        };
+        fmt.write_str(reason)
     }
 }