Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update code for zig 0.9.0 #3

Merged
merged 1 commit into from
Dec 22, 2021
Merged
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 .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -20,13 +20,13 @@ jobs:
- name: Build and Test
uses: goto-bus-stop/setup-zig@v1
with:
version: 0.8.1
version: 0.9.0
- run: zig build test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v1
with:
version: 0.8.1
version: 0.9.0
- run: zig fmt --check .
5 changes: 2 additions & 3 deletions src/base32.zig
Original file line number Diff line number Diff line change
@@ -101,7 +101,6 @@ pub const Encoding = struct {
} else {
var i: usize = 0;
while (i < size) : (i += 1) {
const x = b[i] & 31;
dst[i] = self.buf[b[i] & 31];
}
n += i;
@@ -328,7 +327,7 @@ const pairs = [_]TestPair{

test "Encoding" {
var buf: [1024]u8 = undefined;
for (pairs) |ts, idx| {
for (pairs) |ts| {
const size = std_encoding.encodeLen(ts.decoded.len);
const result = std_encoding.encode(buf[0..size], ts.decoded);
try testing.expectEqualSlices(u8, ts.encoded, result);
@@ -337,7 +336,7 @@ test "Encoding" {

test "Decoding" {
var buf: [1024]u8 = undefined;
for (pairs) |ts, idx| {
for (pairs) |ts| {
const size = std_encoding.decodeLen(ts.encoded.len);
var result = try std_encoding.decode(buf[0..size], ts.encoded);
try testing.expectEqualSlices(u8, ts.decoded, result);