aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorAli Chraghi <chraghiali1@gmail.com>2022-05-22 19:36:59 +0430
committerAndrew Kelley <andrew@ziglang.org>2022-05-27 16:43:33 -0400
commit0e6285c8fc31ff866df96847fe34e660da38b4a9 (patch)
tree5d5830d5b3ce6c13041aacb7e073763551cb4852 /src/main.zig
parentddd5b57045d38b7d1f7d5a4120302797433233cd (diff)
downloadzig-0e6285c8fc31ff866df96847fe34e660da38b4a9.tar.gz
zig-0e6285c8fc31ff866df96847fe34e660da38b4a9.zip
math: make `cast` return optional instead of an error
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig
index 55def40d96..a9085d7c7f 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -4067,7 +4067,7 @@ fn fmtPathFile(
const source_code = try readSourceFileToEndAlloc(
fmt.gpa,
&source_file,
- std.math.cast(usize, stat.size) catch return error.FileTooBig,
+ std.math.cast(usize, stat.size) orelse return error.FileTooBig,
);
defer fmt.gpa.free(source_code);