| author | |
| committer | |
| log | dbda0629708d4b34503945ffaeac8674735b44aa |
| tree | 6dca0728d7e57cd0dba747d71e38a16ed3d1427f |
| parent | 3c223d19106b4bf5670659ebbd4351ab1113175a |
2 files changed, 3 insertions(+), 5 deletions(-)
src/common.zig+1-1| ... | @@ -179,7 +179,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) ! | ... | @@ -179,7 +179,7 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) ! |
| 179 | if (try extras.doesFolderExist(null, pv)) { | 179 | if (try extras.doesFolderExist(null, pv)) { |
| 180 | return pv; | 180 | return pv; |
| 181 | } | 181 | } |
| 182 | const file_name = try u.last(try u.split(options.alloc, d.path, "/")); | 182 | const file_name = u.last(try u.split(options.alloc, d.path, "/")).?; |
| 183 | if (d.version.len > 0) { | 183 | if (d.version.len > 0) { |
| 184 | if (try extras.doesFolderExist(null, pv)) { | 184 | if (try extras.doesFolderExist(null, pv)) { |
| 185 | return pv; | 185 | return pv; |
src/util/funcs.zig+2-4| ... | @@ -79,10 +79,8 @@ pub fn list_remove(alloc: std.mem.Allocator, input: []string, search: string) ![ | ... | @@ -79,10 +79,8 @@ pub fn list_remove(alloc: std.mem.Allocator, input: []string, search: string) ![ |
| 79 | return list.toOwnedSlice(); | 79 | return list.toOwnedSlice(); |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | pub fn last(in: []string) !string { | 82 | pub fn last(in: []string) ?string { |
| 83 | if (in.len == 0) { | 83 | if (in.len == 0) return null; |
| 84 | return error.EmptyArray; | ||
| 85 | } | ||
| 86 | return in[in.len - 1]; | 84 | return in[in.len - 1]; |
| 87 | } | 85 | } |
| 88 | 86 |