diff options
| author | Matthew Kraai <kraai@ftbfs.org> | 2019-12-06 09:09:56 -0800 |
|---|---|---|
| committer | Matthew Kraai <kraai@ftbfs.org> | 2019-12-07 21:23:21 -0500 |
| commit | 2b2b16c2a47512ab30df9ef74d85b9b703f6bbe0 (patch) | |
| tree | 6a1a9acd269e9d662a5cd161dbbf55629d90349d /src/libcore/alloc.rs | |
| parent | de17464b14e503edca6625daa9cd4c338ffafee2 (diff) | |
| download | rust-2b2b16c2a47512ab30df9ef74d85b9b703f6bbe0.tar.gz rust-2b2b16c2a47512ab30df9ef74d85b9b703f6bbe0.zip | |
Simplify `Layout::extend_packed`
Diffstat (limited to 'src/libcore/alloc.rs')
| -rw-r--r-- | src/libcore/alloc.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libcore/alloc.rs b/src/libcore/alloc.rs index 20248f7f6c1..d8e9fe5fbe2 100644 --- a/src/libcore/alloc.rs +++ b/src/libcore/alloc.rs @@ -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]`. |
