diff options
author | Rutger Broekhoff | 2021-09-20 11:57:39 +0200 |
---|---|---|
committer | Rutger Broekhoff | 2021-09-20 11:57:39 +0200 |
commit | 29fb00a1c3a60d4faca2fb29ae56b73362baa917 (patch) | |
tree | 5542426d762402fb5beb66da3ae8c2bc42d80d89 /src/main.zig | |
parent | 1148e92a6a84d5fa65e4e8ef18328fcb4f16664d (diff) | |
download | zig-nkeys-0.3.1.tar.gz zig-nkeys-0.3.1.zip |
Make compatible with Zig master0.3.1
Diffstat (limited to 'src/main.zig')
-rw-r--r-- | src/main.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.zig b/src/main.zig index a299afe..3206f45 100644 --- a/src/main.zig +++ b/src/main.zig | |||
@@ -390,7 +390,7 @@ pub fn areKeySectionContentsValid(contents: []const u8) bool { | |||
390 | return true; | 390 | return true; |
391 | } | 391 | } |
392 | 392 | ||
393 | pub fn findKeySection(line_it: *std.mem.SplitIterator) ?[]const u8 { | 393 | pub fn findKeySection(line_it: *std.mem.SplitIterator(u8)) ?[]const u8 { |
394 | while (true) { | 394 | while (true) { |
395 | const opening_line = line_it.next() orelse return null; | 395 | const opening_line = line_it.next() orelse return null; |
396 | if (!isKeySectionBarrier(opening_line, true)) continue; | 396 | if (!isKeySectionBarrier(opening_line, true)) continue; |
@@ -406,12 +406,12 @@ pub fn findKeySection(line_it: *std.mem.SplitIterator) ?[]const u8 { | |||
406 | } | 406 | } |
407 | 407 | ||
408 | pub fn parseDecoratedJwt(contents: []const u8) []const u8 { | 408 | pub fn parseDecoratedJwt(contents: []const u8) []const u8 { |
409 | var line_it = mem.split(contents, "\n"); | 409 | var line_it = mem.split(u8, contents, "\n"); |
410 | return findKeySection(&line_it) orelse return contents; | 410 | return findKeySection(&line_it) orelse return contents; |
411 | } | 411 | } |
412 | 412 | ||
413 | pub fn parseDecoratedNkey(contents: []const u8) NoNkeySeedFoundError!SeedKeyPair { | 413 | pub fn parseDecoratedNkey(contents: []const u8) NoNkeySeedFoundError!SeedKeyPair { |
414 | var line_it = mem.split(contents, "\n"); | 414 | var line_it = mem.split(u8, contents, "\n"); |
415 | var seed: ?[]const u8 = null; | 415 | var seed: ?[]const u8 = null; |
416 | if (findKeySection(&line_it) != null) | 416 | if (findKeySection(&line_it) != null) |
417 | seed = findKeySection(&line_it); | 417 | seed = findKeySection(&line_it); |
@@ -439,7 +439,7 @@ fn isValidCredsNkey(text: []const u8) bool { | |||
439 | } | 439 | } |
440 | 440 | ||
441 | fn findNkey(text: []const u8) ?[]const u8 { | 441 | fn findNkey(text: []const u8) ?[]const u8 { |
442 | var line_it = std.mem.split(text, "\n"); | 442 | var line_it = std.mem.split(u8, text, "\n"); |
443 | while (line_it.next()) |line| { | 443 | while (line_it.next()) |line| { |
444 | for (line) |c, i| { | 444 | for (line) |c, i| { |
445 | if (!ascii.isSpace(c)) { | 445 | if (!ascii.isSpace(c)) { |