Skip to content

Commit ff60eb2

Browse files
committed
dep-hash: remove superfluous newlines in fatal messages
1 parent 081f781 commit ff60eb2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/compiler/dep-hash.zig

+9-9
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ pub fn main() !void {
7575
});
7676
defer build_root.deinit();
7777

78-
var global_cache_package_directory: std.fs.Dir = l: {
78+
var global_cache: std.fs.Dir = l: {
7979
const p = try std.fs.path.join(arena, &.{
8080
override_global_cache_dir orelse try std.zig.introspect.resolveGlobalCacheDir(arena),
8181
"p",
8282
});
8383

8484
break :l try std.fs.cwd().makeOpenPath(p, .{});
8585
};
86-
defer global_cache_package_directory.close();
86+
defer global_cache.close();
8787

8888
var manifest, var ast = std.zig.loadManifest(gpa, arena, .{
8989
.root_name = null,
@@ -107,14 +107,14 @@ pub fn main() !void {
107107
}
108108
const dep: std.zig.Manifest.Dependency = dep: {
109109
var dep = manifest.dependencies.get(package) orelse {
110-
fatal("there is no dependency named '{s}' in the manifest\n", .{package});
110+
fatal("there is no dependency named '{s}' in the manifest", .{package});
111111
};
112112

113113
try dep_name.appendSlice(package);
114114

115115
for (subdeps.items) |p| {
116116
if (dep.hash) |hash| {
117-
var package_dir = global_cache_package_directory.openDir(hash, .{}) catch |e| switch (e) {
117+
var package_dir = global_cache.openDir(hash, .{}) catch |e| switch (e) {
118118
error.FileNotFound => fatal("{s} is not in the global cache (hash: {s})", .{
119119
dep_name.items, hash,
120120
}),
@@ -136,10 +136,10 @@ pub fn main() !void {
136136
try dep_name.append('.');
137137
try dep_name.appendSlice(p);
138138
} else switch (dep.location) {
139-
.url => fatal("the hash for {s} is missing from the manifest.\n", .{
139+
.url => fatal("the hash for {s} is missing from the manifest.", .{
140140
dep_name.items,
141141
}),
142-
.path => |path| fatal("{s} is a local dependency located at {s}\n", .{
142+
.path => |path| fatal("{s} is a local dependency located at {s}", .{
143143
dep_name.items, path,
144144
}),
145145
}
@@ -152,7 +152,7 @@ pub fn main() !void {
152152

153153
if (dep.hash) |hash| {
154154
if (list) {
155-
var package_dir = global_cache_package_directory.openDir(hash, .{}) catch |e| switch (e) {
155+
var package_dir = global_cache.openDir(hash, .{}) catch |e| switch (e) {
156156
error.FileNotFound => fatal("{s} is not in the global cache (hash: {s})", .{
157157
dep_name.items, hash,
158158
}),
@@ -198,8 +198,8 @@ pub fn main() !void {
198198
try stdout.print("{s}\n", .{hash});
199199
}
200200
} else switch (dep.location) {
201-
.url => fatal("the hash for {s} is missing from the manifest.\n", .{package}),
202-
.path => |path| fatal("{s} is a local dependency located at {s}\n", .{ package, path }),
201+
.url => fatal("the hash for {s} is missing from the manifest.", .{package}),
202+
.path => |path| fatal("{s} is a local dependency located at {s}", .{ package, path }),
203203
}
204204
} else {
205205
try listDepHashes("", manifest);

0 commit comments

Comments
 (0)