aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig8
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
393pub fn findKeySection(line_it: *std.mem.SplitIterator) ?[]const u8 { 393pub 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
408pub fn parseDecoratedJwt(contents: []const u8) []const u8 { 408pub 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
413pub fn parseDecoratedNkey(contents: []const u8) NoNkeySeedFoundError!SeedKeyPair { 413pub 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
441fn findNkey(text: []const u8) ?[]const u8 { 441fn 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)) {