From 66717db735b9ddac9298bf08fcf95e7e11629fee Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 7 Jan 2018 16:51:46 -0500 Subject: replace `%return` with `try` See #632 better fits the convention of using keywords for control flow --- std/debug/failing_allocator.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'std/debug/failing_allocator.zig') diff --git a/std/debug/failing_allocator.zig b/std/debug/failing_allocator.zig index 9b12ff5cb7..2076a4cf1f 100644 --- a/std/debug/failing_allocator.zig +++ b/std/debug/failing_allocator.zig @@ -33,7 +33,7 @@ pub const FailingAllocator = struct { if (self.index == self.fail_index) { return error.OutOfMemory; } - const result = %return self.internal_allocator.allocFn(self.internal_allocator, n, alignment); + const result = try self.internal_allocator.allocFn(self.internal_allocator, n, alignment); self.allocated_bytes += result.len; self.index += 1; return result; @@ -48,7 +48,7 @@ pub const FailingAllocator = struct { if (self.index == self.fail_index) { return error.OutOfMemory; } - const result = %return self.internal_allocator.reallocFn(self.internal_allocator, old_mem, new_size, alignment); + const result = try self.internal_allocator.reallocFn(self.internal_allocator, old_mem, new_size, alignment); self.allocated_bytes += new_size - old_mem.len; self.deallocations += 1; self.index += 1; -- cgit v1.2.3