Skip to content

Commit 2b2b16c

Browse files
committed
Simplify Layout::extend_packed
1 parent de17464 commit 2b2b16c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libcore/alloc.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ impl Layout {
310310
pub fn extend_packed(&self, next: Self) -> Result<Self, LayoutErr> {
311311
let new_size = self.size().checked_add(next.size())
312312
.ok_or(LayoutErr { private: () })?;
313-
let layout = Layout::from_size_align(new_size, self.align())?;
314-
Ok(layout)
313+
Layout::from_size_align(new_size, self.align())
315314
}
316315

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

0 commit comments

Comments
 (0)