From eafe50fbf07388c03d6e052031296265bbc55643 Mon Sep 17 00:00:00 2001 From: Jud Hembree Date: Wed, 11 Dec 2024 23:54:18 -0500 Subject: fixup README.md spanZ is no longer in the standard. Found an alternate way to run the example. Updating readme for the next guy. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index b26708c..4454e9c 100644 --- a/README.md +++ b/README.md @@ -227,8 +227,8 @@ const row = try stmt.one( .{}, .{ .id = 20 }, ); -if (row) |row| { - std.log.debug("name: {}, age: {}", .{std.mem.spanZ(&row.name), row.age}); +if (row) |r| { + std.log.debug("name: {}, age: {}", .{std.mem.span((&row.name).ptr), row.age}); } ``` Notice that to read text we need to use a 0-terminated array; if the `name` column is bigger than 127 bytes the call to `one` will fail. -- cgit v1.2.3