mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
Format the match statement
This commit is contained in:
parent
88f8b88160
commit
599cd683ea
@ -85,12 +85,15 @@ impl Display for TryReserveError {
|
|||||||
fmt: &mut core::fmt::Formatter<'_>,
|
fmt: &mut core::fmt::Formatter<'_>,
|
||||||
) -> core::result::Result<(), core::fmt::Error> {
|
) -> core::result::Result<(), core::fmt::Error> {
|
||||||
fmt.write_str("memory allocation failed")?;
|
fmt.write_str("memory allocation failed")?;
|
||||||
fmt.write_str(match &self {
|
let reason = match &self {
|
||||||
TryReserveError::CapacityOverflow => {
|
TryReserveError::CapacityOverflow => {
|
||||||
" because the computed capacity exceeded the collection's maximum"
|
" 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user