diff options
author | Martin Ashby <martin@ashbysoft.com> | 2024-02-01 14:39:26 +0000 |
---|---|---|
committer | Martin Ashby <martin@ashbysoft.com> | 2024-02-01 14:39:26 +0000 |
commit | 8b47802e383dde95650f9d24e88c2f67f6596a98 (patch) | |
tree | 079ed8f37b793036812b8732b8625bc423e03572 /comments/src | |
parent | a3ed80acdbd1b92e61fbe50b0e38e05e82583503 (diff) | |
download | mfashby.net-8b47802e383dde95650f9d24e88c2f67f6596a98.tar.gz mfashby.net-8b47802e383dde95650f9d24e88c2f67f6596a98.tar.bz2 mfashby.net-8b47802e383dde95650f9d24e88c2f67f6596a98.tar.xz mfashby.net-8b47802e383dde95650f9d24e88c2f67f6596a98.zip |
Update for zig master
Diffstat (limited to 'comments/src')
-rw-r--r-- | comments/src/main.zig | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/comments/src/main.zig b/comments/src/main.zig index 8710d95..ac8193e 100644 --- a/comments/src/main.zig +++ b/comments/src/main.zig @@ -7,33 +7,34 @@ const smtp = @import("smtp"); const Params = zws.Params; const Err = error{ - Unexpected, AccessDenied, - OutOfMemory, - InputOutput, - SystemResources, - IsDir, - OperationAborted, BrokenPipe, + ColumnNotFound, ConnectionResetByPeer, ConnectionTimedOut, - NotOpenForReading, - NetNameDeleted, - WouldBlock, - StreamTooLong, - Malformatted, - InvalidLength, - InvalidCharacter, - NoSpaceLeft, - PqError, - ColumnNotFound, + DeviceBusy, DiskQuota, FileTooBig, - DeviceBusy, + InputOutput, InvalidArgument, - NotOpenForWriting, - LockViolation, + InvalidCharacter, + InvalidLength, InvalidRequestMethod, + IsDir, + LockViolation, + Malformatted, + NetNameDeleted, + NoSpaceLeft, + NotOpenForReading, + NotOpenForWriting, + OperationAborted, + OutOfMemory, + PqError, + SocketNotConnected, + StreamTooLong, + SystemResources, + Unexpected, + WouldBlock, }; const Ctx = struct { db: pq.Db, @@ -204,7 +205,7 @@ fn get_comment(res: *Response, ctx: Ctx, _: Params) Err!void { fn post_comment(res: *Response, ctx: Ctx, _: Params) Err!void { var body_aa = std.ArrayList(u8).init(res.allocator); try res.reader().readAllArrayList(&body_aa, 1_000_000); - var body = try body_aa.toOwnedSlice(); + const body = try body_aa.toOwnedSlice(); var form = try zws.Form.parse(res.allocator, body); const Form = struct { url: []const u8, |