From 599cd683eac7fdb076fe86f2928062e087214a22 Mon Sep 17 00:00:00 2001 From: Lena Wildervanck Date: Wed, 11 Mar 2020 17:30:04 +0100 Subject: Format the match statement --- src/liballoc/collections/mod.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/liballoc') 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) } } -- cgit 1.4.1-3-g733a5