Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/winsys/EventQueue.zig
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ test "fuzz: no stuck input, balanced downs and ups, time that only goes forward"
const w: usize = if (e.window) |win| win.id - 1 else 0;
switch (e.payload) {
.key => |k| {
const c = std.mem.indexOfScalar(Event.Code, &codes, k.physical).?;
const c = std.mem.findScalar(Event.Code, &codes, k.physical).?;
switch (k.action) {
.down => {
try std.testing.expect(!m.keys[w][c]);
Expand All @@ -862,7 +862,7 @@ test "fuzz: no stuck input, balanced downs and ups, time that only goes forward"
}
},
.pointer => |p| {
const b = std.mem.indexOfScalar(Event.Button, &buttons, p.button).?;
const b = std.mem.findScalar(Event.Button, &buttons, p.button).?;
switch (p.kind) {
.press => {
try std.testing.expect(!m.buttons[w][b]);
Expand Down
2 changes: 1 addition & 1 deletion build/plugins.zig
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ const Rehome = struct {
for (src.c_macros.items) |macro| {
// `addCMacro` stores `-Dname=value`.
const body = macro["-D".len..];
const eq = std.mem.indexOfScalar(u8, body, '=') orelse body.len;
const eq = std.mem.findScalar(u8, body, '=') orelse body.len;
m.addCMacro(body[0..eq], if (eq < body.len) body[eq + 1 ..] else "");
}
for (src.lib_paths.items) |p| m.addLibraryPath(p);
Expand Down
2 changes: 1 addition & 1 deletion scripts/lint.zig
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ fn analyze(allocator: std.mem.Allocator, source: [:0]const u8) ![]Finding {
const text = std.mem.trim(u8, line[comment + 2 ..], " \t\r");
const prefix = "lint-allow(";
if (!std.mem.startsWith(u8, text, prefix)) continue;
const close = std.mem.indexOfScalar(u8, text, ')') orelse text.len;
const close = std.mem.findScalar(u8, text, ')') orelse text.len;
const tail = if (close < text.len) std.mem.trim(u8, text[close + 1 ..], " \t\r") else "";
if (tail.len < 2 or tail[0] != ':' or std.mem.trim(u8, tail[1..], " \t\r").len == 0) {
try findings.append(allocator, .{ .rule = .@"lint-allow-reason", .line = line_number, .message = "lint-allow requires a reason after ':'" });
Expand Down
4 changes: 2 additions & 2 deletions tests/integration.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11839,9 +11839,9 @@ test "settings: an untouched in-app material is not written; a chosen one is" {
var s: Settings = .{};
const plain = try s.serialize(gpa);
defer gpa.free(plain);
try std.testing.expect(std.mem.indexOf(u8, plain, "in_app_material") == null);
try std.testing.expect(std.mem.find(u8, plain, "in_app_material") == null);
s.in_app_material = .frost;
const chosen = try s.serialize(gpa);
defer gpa.free(chosen);
try std.testing.expect(std.mem.indexOf(u8, chosen, ".in_app_material = .frost") != null);
try std.testing.expect(std.mem.find(u8, chosen, ".in_app_material = .frost") != null);
}
Loading