From b39280af94eb27d09c67babe21b5e8ef69f1a95c Mon Sep 17 00:00:00 2001 From: Paul Kirby Date: Sun, 30 Apr 2023 11:02:57 -0400 Subject: [PATCH 1/2] Updated to not use extras 'range' function --- time.zig | 3 +-- zig.mod | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/time.zig b/time.zig index d67ee27b696a0ae5d6c143209c9620d9b78df4c9..9eb0634063ef9778c308948310120af54aee3179 100644 --- a/time.zig +++ b/time.zig @@ -1,6 +1,5 @@ const std = @import("std"); const string = []const u8; -const range = extras.range; const extras = @import("extras"); const time = @This(); @@ -187,7 +186,7 @@ pub const DateTime = struct { pub fn dayOfThisYear(self: Self) u16 { var ret: u16 = 0; - for (range(self.months), 0..) |_, item| { + for (0..self.months, 0..) |_, item| { ret += self.daysInMonth(@intCast(u16, item)); } ret += self.days; diff --git a/zig.mod b/zig.mod index 6b946542e2a156d751bb22100446a55dc9c7b5cf..6e5c78e1269f1cfdc492cb657bac8772d43e27c1 100644 --- a/zig.mod +++ b/zig.mod @@ -3,5 +3,6 @@ name: time main: time.zig license: MIT description: A date and time parsing and formatting library for Zig. +min_zig_version: 0.11.0-dev.1681+0bb178bbb dependencies: - src: git https://github.com/nektro/zig-extras -- 2.54.0 From 3d916be3ed8e466b2af5f68a63b188435b4d7af5 Mon Sep 17 00:00:00 2001 From: Paul Kirby Date: Sun, 30 Apr 2023 15:23:38 -0400 Subject: [PATCH 2/2] Removed redundant index-part --- time.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time.zig b/time.zig index 9eb0634063ef9778c308948310120af54aee3179..cf68ceda8a65d677d936db9a59adcc5571fff3b8 100644 --- a/time.zig +++ b/time.zig @@ -186,7 +186,7 @@ pub const DateTime = struct { pub fn dayOfThisYear(self: Self) u16 { var ret: u16 = 0; - for (0..self.months, 0..) |_, item| { + for (0..self.months) |item| { ret += self.daysInMonth(@intCast(u16, item)); } ret += self.days; -- 2.54.0