Skip to content

Commit eafe50f

Browse files
fixup README.md
spanZ is no longer in the standard. Found an alternate way to run the example. Updating readme for the next guy.
1 parent e95c014 commit eafe50f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ const row = try stmt.one(
227227
.{},
228228
.{ .id = 20 },
229229
);
230-
if (row) |row| {
231-
std.log.debug("name: {}, age: {}", .{std.mem.spanZ(&row.name), row.age});
230+
if (row) |r| {
231+
std.log.debug("name: {}, age: {}", .{std.mem.span((&row.name).ptr), row.age});
232232
}
233233
```
234234
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.

0 commit comments

Comments
 (0)