aboutsummaryrefslogtreecommitdiff
path: root/std/mem.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-06-14 18:27:59 -0400
committerAndrew Kelley <superjoe30@gmail.com>2018-06-14 18:27:59 -0400
commit32dd98b19fe3cc384df32704dac0ff3e377dbe0c (patch)
tree2eddf3618d80313bdd24c25bd589bd474f3d82fc /std/mem.zig
parentef7f69d14a017c6c2065e4a376bb8e1f05ace04b (diff)
parentf0697c28f80d64c544302aea576e41ebc443b41c (diff)
downloadzig-32dd98b19fe3cc384df32704dac0ff3e377dbe0c.tar.gz
zig-32dd98b19fe3cc384df32704dac0ff3e377dbe0c.zip
Merge remote-tracking branch 'origin/master' into llvm7
Diffstat (limited to 'std/mem.zig')
-rw-r--r--std/mem.zig22
1 files changed, 11 insertions, 11 deletions
diff --git a/std/mem.zig b/std/mem.zig
index 423460e73b..f961c7862b 100644
--- a/std/mem.zig
+++ b/std/mem.zig
@@ -304,20 +304,20 @@ pub fn indexOfPos(comptime T: type, haystack: []const T, start_index: usize, nee
}
test "mem.indexOf" {
- assert(??indexOf(u8, "one two three four", "four") == 14);
- assert(??lastIndexOf(u8, "one two three two four", "two") == 14);
+ assert(indexOf(u8, "one two three four", "four").? == 14);
+ assert(lastIndexOf(u8, "one two three two four", "two").? == 14);
assert(indexOf(u8, "one two three four", "gour") == null);
assert(lastIndexOf(u8, "one two three four", "gour") == null);
- assert(??indexOf(u8, "foo", "foo") == 0);
- assert(??lastIndexOf(u8, "foo", "foo") == 0);
+ assert(indexOf(u8, "foo", "foo").? == 0);
+ assert(lastIndexOf(u8, "foo", "foo").? == 0);
assert(indexOf(u8, "foo", "fool") == null);
assert(lastIndexOf(u8, "foo", "lfoo") == null);
assert(lastIndexOf(u8, "foo", "fool") == null);
- assert(??indexOf(u8, "foo foo", "foo") == 0);
- assert(??lastIndexOf(u8, "foo foo", "foo") == 4);
- assert(??lastIndexOfAny(u8, "boo, cat", "abo") == 6);
- assert(??lastIndexOfScalar(u8, "boo", 'o') == 2);
+ assert(indexOf(u8, "foo foo", "foo").? == 0);
+ assert(lastIndexOf(u8, "foo foo", "foo").? == 4);
+ assert(lastIndexOfAny(u8, "boo, cat", "abo").? == 6);
+ assert(lastIndexOfScalar(u8, "boo", 'o').? == 2);
}
/// Reads an integer from memory with size equal to bytes.len.
@@ -432,9 +432,9 @@ pub fn split(buffer: []const u8, split_bytes: []const u8) SplitIterator {
test "mem.split" {
var it = split(" abc def ghi ", " ");
- assert(eql(u8, ??it.next(), "abc"));
- assert(eql(u8, ??it.next(), "def"));
- assert(eql(u8, ??it.next(), "ghi"));
+ assert(eql(u8, it.next().?, "abc"));
+ assert(eql(u8, it.next().?, "def"));
+ assert(eql(u8, it.next().?, "ghi"));
assert(it.next() == null);
}