We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 88f8b88 commit 599cd68Copy full SHA for 599cd68
src/liballoc/collections/mod.rs
@@ -85,12 +85,15 @@ impl Display for TryReserveError {
85
fmt: &mut core::fmt::Formatter<'_>,
86
) -> core::result::Result<(), core::fmt::Error> {
87
fmt.write_str("memory allocation failed")?;
88
- fmt.write_str(match &self {
+ let reason = match &self {
89
TryReserveError::CapacityOverflow => {
90
" because the computed capacity exceeded the collection's maximum"
91
}
92
- TryReserveError::AllocError { .. } => " because the memory allocator returned a error",
93
- })
+ TryReserveError::AllocError { .. } => {
+ " because the memory allocator returned a error"
94
+ }
95
+ };
96
+ fmt.write_str(reason)
97
98
99
0 commit comments