Skip to content

Commit 599cd68

Browse files
committed
Format the match statement
1 parent 88f8b88 commit 599cd68

File tree

1 file changed

+6
-3
lines changed
  • src/liballoc/collections

1 file changed

+6
-3
lines changed

src/liballoc/collections/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,15 @@ impl Display for TryReserveError {
8585
fmt: &mut core::fmt::Formatter<'_>,
8686
) -> core::result::Result<(), core::fmt::Error> {
8787
fmt.write_str("memory allocation failed")?;
88-
fmt.write_str(match &self {
88+
let reason = match &self {
8989
TryReserveError::CapacityOverflow => {
9090
" because the computed capacity exceeded the collection's maximum"
9191
}
92-
TryReserveError::AllocError { .. } => " because the memory allocator returned a error",
93-
})
92+
TryReserveError::AllocError { .. } => {
93+
" because the memory allocator returned a error"
94+
}
95+
};
96+
fmt.write_str(reason)
9497
}
9598
}
9699

0 commit comments

Comments
 (0)