| ... | @@ -211,7 +211,7 @@ pub fn parse(alloc: std.mem.Allocator, input: string) !Document { | ... | @@ -211,7 +211,7 @@ pub fn parse(alloc: std.mem.Allocator, input: string) !Document { |
| 211 | _ = c.yaml_parser_initialize(&parser); | 211 | _ = c.yaml_parser_initialize(&parser); |
| 212 | defer c.yaml_parser_delete(&parser); | 212 | defer c.yaml_parser_delete(&parser); |
| 213 | | 213 | |
| 214 | const lines = try split(alloc, input, "\n"); | 214 | const lines = try split(alloc, input, '\n'); |
| 215 | defer alloc.free(lines); | 215 | defer alloc.free(lines); |
| 216 | | 216 | |
| 217 | _ = c.yaml_parser_set_input_string(&parser, input.ptr, input.len); | 217 | _ = c.yaml_parser_set_input_string(&parser, input.ptr, input.len); |
| ... | @@ -381,11 +381,11 @@ fn get_event_string(event: Token, p: *const Parser) !string { | ... | @@ -381,11 +381,11 @@ fn get_event_string(event: Token, p: *const Parser) !string { |
| 381 | // | 381 | // |
| 382 | // | 382 | // |
| 383 | | 383 | |
| 384 | fn split(alloc: std.mem.Allocator, in: string, delim: string) ![]string { | 384 | fn split(alloc: std.mem.Allocator, in: string, delim: u8) ![]string { |
| 385 | var list = std.ArrayList(string).init(alloc); | 385 | var list = std.ArrayList(string).init(alloc); |
| 386 | errdefer list.deinit(); | 386 | errdefer list.deinit(); |
| 387 | | 387 | |
| 388 | var iter = std.mem.split(u8, in, delim); | 388 | var iter = std.mem.splitScalar(u8, in, delim); |
| 389 | while (iter.next()) |str| { | 389 | while (iter.next()) |str| { |
| 390 | try list.append(str); | 390 | try list.append(str); |
| 391 | } | 391 | } |