replace %return with try
See #632 better fits the convention of using keywords for control flow
This commit is contained in:
@@ -162,7 +162,7 @@ fn testValid(bytes: []const u8, expected_codepoint: u32) {
|
||||
}
|
||||
|
||||
fn testDecode(bytes: []const u8) -> %u32 {
|
||||
const length = %return utf8ByteSequenceLength(bytes[0]);
|
||||
const length = try utf8ByteSequenceLength(bytes[0]);
|
||||
if (bytes.len < length) return error.UnexpectedEof;
|
||||
std.debug.assert(bytes.len == length);
|
||||
return utf8Decode(bytes);
|
||||
|
||||
Reference in New Issue
Block a user