replace %defer with errdefer

See #632

now we have 1 less sigil
This commit is contained in:
Andrew Kelley
2018-01-23 23:08:09 -05:00
parent ad2527d47a
commit b3a6faf13e
21 changed files with 87 additions and 89 deletions

View File

@@ -550,7 +550,7 @@ pub fn readFileAllocExtra(path: []const u8, allocator: &mem.Allocator, extra_len
const size = try file.getEndPos();
const buf = try allocator.alloc(u8, size + extra_len);
%defer allocator.free(buf);
errdefer allocator.free(buf);
var adapter = FileInStream.init(&file);
try adapter.stream.readNoEof(buf[0..size]);