diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-01-09 09:56:24 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-01-09 09:56:24 -0500 |
| commit | d1d3dbc7b5bc986849db476e491300ffd18d4db5 (patch) | |
| tree | 8ab3bb2b5b8a82edf18caca6e28dc8e74ab81d11 /std/unicode.zig | |
| parent | 5a8d87f5042b5ab86de7c72df4ce84a314878e40 (diff) | |
| parent | 3c094116aae459b651934663a31981cf09cdb3e4 (diff) | |
| download | zig-d1d3dbc7b5bc986849db476e491300ffd18d4db5.tar.gz zig-d1d3dbc7b5bc986849db476e491300ffd18d4db5.zip | |
Merge branch 'master' into llvm6
Diffstat (limited to 'std/unicode.zig')
| -rw-r--r-- | std/unicode.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/std/unicode.zig b/std/unicode.zig index c821011558..d21ed0204a 100644 --- a/std/unicode.zig +++ b/std/unicode.zig @@ -19,7 +19,7 @@ error Utf8EncodesSurrogateHalf; error Utf8CodepointTooLarge; /// Decodes the UTF-8 codepoint encoded in the given slice of bytes. -/// bytes.len must be equal to %%utf8ByteSequenceLength(bytes[0]). +/// bytes.len must be equal to utf8ByteSequenceLength(bytes[0]) catch unreachable. /// If you already know the length at comptime, you can call one of /// utf8Decode2,utf8Decode3,utf8Decode4 directly instead of this function. pub fn utf8Decode(bytes: []const u8) -> %u32 { @@ -158,7 +158,7 @@ fn testError(bytes: []const u8, expected_err: error) { } fn testValid(bytes: []const u8, expected_codepoint: u32) { - std.debug.assert(%%testDecode(bytes) == expected_codepoint); + std.debug.assert((testDecode(bytes) catch unreachable) == expected_codepoint); } fn testDecode(bytes: []const u8) -> %u32 { |
