Skip to content

Commit

Permalink
Rollup merge of rust-lang#67138 - kraai:simplify-Layout-extend_packed…
Browse files Browse the repository at this point in the history
…, r=Amanieu

Simplify `Layout::extend_packed`
  • Loading branch information
Centril committed Dec 8, 2019
2 parents 3824e76 + 2b2b16c commit 4387e7b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libcore/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ impl Layout {
pub fn extend_packed(&self, next: Self) -> Result<Self, LayoutErr> {
let new_size = self.size().checked_add(next.size())
.ok_or(LayoutErr { private: () })?;
let layout = Layout::from_size_align(new_size, self.align())?;
Ok(layout)
Layout::from_size_align(new_size, self.align())
}

/// Creates a layout describing the record for a `[T; n]`.
Expand Down

0 comments on commit 4387e7b

Please sign in to comment.