Rollup merge of #67138 - kraai:simplify-Layout-extend_packed, r=Amanieu
Simplify `Layout::extend_packed`
This commit is contained in:
commit
6b6b6f3220
@ -310,8 +310,7 @@ impl Layout {
|
|||||||
pub fn extend_packed(&self, next: Self) -> Result<Self, LayoutErr> {
|
pub fn extend_packed(&self, next: Self) -> Result<Self, LayoutErr> {
|
||||||
let new_size = self.size().checked_add(next.size())
|
let new_size = self.size().checked_add(next.size())
|
||||||
.ok_or(LayoutErr { private: () })?;
|
.ok_or(LayoutErr { private: () })?;
|
||||||
let layout = Layout::from_size_align(new_size, self.align())?;
|
Layout::from_size_align(new_size, self.align())
|
||||||
Ok(layout)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a layout describing the record for a `[T; n]`.
|
/// Creates a layout describing the record for a `[T; n]`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user