diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-02-07 17:19:51 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-02-07 17:23:50 -0500 |
| commit | 8a859afd580f438f549ee69a3e3487eb5d119fad (patch) | |
| tree | cbbd2d01bdd73a160b90dc280e7fbc05e7d963a8 /std/str.zig | |
| parent | 92793252ad43c4119902506f95e726de3492c128 (diff) | |
| download | zig-8a859afd580f438f549ee69a3e3487eb5d119fad.tar.gz zig-8a859afd580f438f549ee69a3e3487eb5d119fad.zip | |
std.io supports printing integers as hex values
remove "unnecessary if statement" error
this "depends on compile variable" code is too hard to validate,
and has false negatives. not worth it right now.
std.str removed, instead use std.mem.
std.mem.eql and std.mem.sliceEql merged and do not require explicit
type argument.
Diffstat (limited to 'std/str.zig')
| -rw-r--r-- | std/str.zig | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/std/str.zig b/std/str.zig deleted file mode 100644 index bb891b37ef..0000000000 --- a/std/str.zig +++ /dev/null @@ -1,21 +0,0 @@ -const assert = @import("debug.zig").assert; - -pub fn eql(a: []const u8, b: []const u8) -> bool { - sliceEql(u8, a, b) -} - -pub fn sliceEql(comptime T: type, a: []const T, b: []const T) -> bool { - if (a.len != b.len) return false; - for (a) |item, index| { - if (b[index] != item) return false; - } - return true; -} - -fn testStringEquality() { - @setFnTest(this); - - assert(eql("abcd", "abcd")); - assert(!eql("abcdef", "abZdef")); - assert(!eql("abcdefg", "abcdef")); -} |
