diff options
| author | Peter <peter.wilkins@polecat.com> | 2019-12-08 23:16:18 +0000 |
|---|---|---|
| committer | Peter <peter.wilkins@polecat.com> | 2019-12-08 23:49:30 +0000 |
| commit | 8f6a06285efe12d778ff7f44067aebeed7b14428 (patch) | |
| tree | 856b9d17a8e4700c44a2794e63ec75ecf9660397 /src/liballoc/raw_vec | |
| parent | 947772fc31b96ce90f57720f74571f14e35df66b (diff) | |
| parent | 59947fcae6a40df12e33af8c8c7291014b7603e0 (diff) | |
| download | rust-8f6a06285efe12d778ff7f44067aebeed7b14428.tar.gz rust-8f6a06285efe12d778ff7f44067aebeed7b14428.zip | |
move from non zero impls to `libcore/convert/num.rs`
Diffstat (limited to 'src/liballoc/raw_vec')
| -rw-r--r-- | src/liballoc/raw_vec/tests.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/liballoc/raw_vec/tests.rs b/src/liballoc/raw_vec/tests.rs index d35b62fc1ef..b214cef3011 100644 --- a/src/liballoc/raw_vec/tests.rs +++ b/src/liballoc/raw_vec/tests.rs @@ -16,7 +16,9 @@ fn allocator_param() { // A dumb allocator that consumes a fixed amount of fuel // before allocation attempts start failing. - struct BoundedAlloc { fuel: usize } + struct BoundedAlloc { + fuel: usize, + } unsafe impl Alloc for BoundedAlloc { unsafe fn alloc(&mut self, layout: Layout) -> Result<NonNull<u8>, AllocErr> { let size = layout.size(); @@ -24,7 +26,10 @@ fn allocator_param() { return Err(AllocErr); } match Global.alloc(layout) { - ok @ Ok(_) => { self.fuel -= size; ok } + ok @ Ok(_) => { + self.fuel -= size; + ok + } err @ Err(_) => err, } } |
