authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2023-04-30 17:12:40 -07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-04-30 17:12:40 -07:00
log5af3b0775f25974a11ff5a839df452c87796d252
treeeb1444dc79ce43ea59e331d5fd1795cad2759dba
parent6094c777eb7b7fbadbf5102f3872d3ad0a2a630e
parent3d916be3ed8e466b2af5f68a63b188435b4d7af5
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #4 from shipsaw/master

Updated to not use extras 'range' function

2 files changed, 2 insertions(+), 2 deletions(-)

time.zig+1-2
...@@ -1,6 +1,5 @@...@@ -1,6 +1,5 @@
1const std = @import("std");1const std = @import("std");
2const string = []const u8;2const string = []const u8;
3const range = extras.range;
4const extras = @import("extras");3const extras = @import("extras");
5const time = @This();4const time = @This();
65
...@@ -187,7 +186,7 @@ pub const DateTime = struct {...@@ -187,7 +186,7 @@ pub const DateTime = struct {
187186
188 pub fn dayOfThisYear(self: Self) u16 {187 pub fn dayOfThisYear(self: Self) u16 {
189 var ret: u16 = 0;188 var ret: u16 = 0;
190 for (range(self.months), 0..) |_, item| {189 for (0..self.months) |item| {
191 ret += self.daysInMonth(@intCast(u16, item));190 ret += self.daysInMonth(@intCast(u16, item));
192 }191 }
193 ret += self.days;192 ret += self.days;
zig.mod+1
...@@ -3,5 +3,6 @@ name: time...@@ -3,5 +3,6 @@ name: time
3main: time.zig3main: time.zig
4license: MIT4license: MIT
5description: A date and time parsing and formatting library for Zig.5description: A date and time parsing and formatting library for Zig.
6min_zig_version: 0.11.0-dev.1681+0bb178bbb
6dependencies:7dependencies:
7 - src: git https://github.com/nektro/zig-extras8 - src: git https://github.com/nektro/zig-extras