We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a5fecc6 commit 0791187Copy full SHA for 0791187
library/core/src/alloc/layout.rs
@@ -326,10 +326,8 @@ impl Layout {
326
let alloc_size = padded_size.checked_mul(n).ok_or(LayoutError)?;
327
328
// The safe constructor is called here to enforce the isize size limit.
329
- match Layout::from_size_alignment(alloc_size, self.align) {
330
- Ok(layout) => Ok((layout, padded_size)),
331
- Err(e) => Err(e),
332
- }
+ let layout = Layout::from_size_alignment(alloc_size, self.align)?;
+ Ok((layout, padded_size))
333
}
334
335
/// Creates a layout describing the record for `self` followed by
0 commit comments