diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b9d20d5..4bb880a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,6 @@ jobs: submodules: true - uses: goto-bus-stop/setup-zig@v2 with: - version: 0.11.0 + version: 0.13.0 - name: Build run: zig build test diff --git a/.gitignore b/.gitignore index 3cef7be..1dfcbd2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -zig-cache/ +.zig-cache/ diff --git a/README.md b/README.md index 4715a74..5ab25e0 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![CI](https://github.com/ziglibs/zig-string-searching/workflows/CI/badge.svg) Implementation of some string-search algorithms in -[zig](https://ziglang.org). Compatible with zig v0.11.0. +[zig](https://ziglang.org). Compatible with zig 0.13.0. ### Boyer-Moore string searching diff --git a/build.zig b/build.zig index 51f4863..0e0a994 100644 --- a/build.zig +++ b/build.zig @@ -1,11 +1,11 @@ -const Builder = @import("std").build.Builder; +const Build = @import("std").Build; -pub fn build(b: *Builder) void { +pub fn build(b: *Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); const main_tests = b.addTest(.{ - .root_source_file = .{ .path = "src/main.zig" }, + .root_source_file = b.path("src/main.zig"), .target = target, .optimize = optimize, }); diff --git a/src/bitap.zig b/src/bitap.zig index 80a8fa8..4e2ae70 100644 --- a/src/bitap.zig +++ b/src/bitap.zig @@ -14,7 +14,6 @@ pub fn bitap( text: T, pattern: T, ) ?usize { - assert(std.meta.trait.isIndexable(T)); const ElemType = std.meta.Elem(T); assert(@typeInfo(ElemType) == .Int); assert(pattern.len <= max_pattern_length); diff --git a/src/boyer_moore.zig b/src/boyer_moore.zig index 9e4e6f2..a9b2876 100644 --- a/src/boyer_moore.zig +++ b/src/boyer_moore.zig @@ -7,7 +7,6 @@ const test_suites = @import("test_cases.zig").test_suites; const possibleValues = @import("common.zig").possibleValues; pub fn StringFinder(comptime T: type) type { - assert(std.meta.trait.isIndexable(T)); const ElemType = std.meta.Elem(T); assert(@typeInfo(ElemType) == .Int); diff --git a/src/rabin_karp.zig b/src/rabin_karp.zig index e0fe400..d33eb65 100644 --- a/src/rabin_karp.zig +++ b/src/rabin_karp.zig @@ -7,12 +7,14 @@ const test_suites = @import("test_cases.zig").test_suites; pub fn byteRabinKarp(text: []const u8, pattern: []const u8) ?usize { const hashFn = struct { pub fn f(str: []const u8) usize { + // TODO return 0; } }.f; const continueHashFn = struct { pub fn f(h: usize, x: u8) usize { + // TODO return 0; } }.f;