aboutsummaryrefslogtreecommitdiff
path: root/src/router.zig
diff options
context:
space:
mode:
authorGravatar Dylan Conway <35280289+dylan-conway@users.noreply.github.com> 2023-02-23 23:57:19 -0800
committerGravatar GitHub <noreply@github.com> 2023-02-23 23:57:19 -0800
commit3f04f8d0a653cf5decef2225c2044742b382718a (patch)
tree91eb6500834e3157ecb9ab208101aa368a1191c8 /src/router.zig
parentb5bdde28ed34070cbb1d34d13f414f4c513ee40d (diff)
downloadbun-3f04f8d0a653cf5decef2225c2044742b382718a.tar.gz
bun-3f04f8d0a653cf5decef2225c2044742b382718a.tar.zst
bun-3f04f8d0a653cf5decef2225c2044742b382718a.zip
Upgrade Zig (#2151)
* fixup * Upgrade Zig * Remove bad assertion * strings * bump * mode -> optimize * optimize * Linux build * Update bindgen.zig
Diffstat (limited to '')
-rw-r--r--src/router.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/router.zig b/src/router.zig
index e29df954d..c7dadcdd3 100644
--- a/src/router.zig
+++ b/src/router.zig
@@ -364,7 +364,7 @@ const RouteLoader = struct {
var dynamic_start: ?usize = null;
var index_id: ?usize = null;
- for (this.all_routes.items) |route, i| {
+ for (this.all_routes.items, 0..) |route, i| {
if (@enumToInt(route.kind) > @enumToInt(Pattern.Tag.static) and dynamic_start == null) {
dynamic_start = i;
}
@@ -926,7 +926,8 @@ fn makeTest(cwd_path: string, data: anytype) !void {
try cwd.makePath(dir);
}
var file = try cwd.createFile(field.name, .{ .truncate = true });
- try file.writeAll(std.mem.span(value));
+ try file.writeAll(value);
+
file.close();
}
}
@@ -1540,7 +1541,7 @@ test "Pattern Match" {
}
if (comptime entries.len > 0) {
- for (parameters.items(.name)) |entry_name, i| {
+ for (parameters.items(.name), 0..) |entry_name, i| {
if (!strings.eql(entry_name, entries[i].name)) {
failures += 1;
Output.prettyErrorln("{s} -- Expected name <b>\"{s}\"<r> but received <b>\"{s}\"<r> for path {s}", .{ pattern, entries[i].name, parameters.get(i).name, pathname });