diff options
| author | Lena Wildervanck <Lena.Wildervanck@gmail.com> | 2020-03-11 17:30:04 +0100 |
|---|---|---|
| committer | Lena Wildervanck <Lena.Wildervanck@gmail.com> | 2020-03-11 17:30:04 +0100 |
| commit | 599cd683eac7fdb076fe86f2928062e087214a22 (patch) | |
| tree | 4497d661a95d5a54d5420710d3e49affc1501ece /src/liballoc | |
| parent | 88f8b881606aa22fdaabcefbf88ddc163e41d8e6 (diff) | |
| download | rust-599cd683eac7fdb076fe86f2928062e087214a22.tar.gz rust-599cd683eac7fdb076fe86f2928062e087214a22.zip | |
Format the match statement
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/collections/mod.rs | 9 |
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) } } |
