commit 9efbbdbfab68a665e0ce60f92407645b37d56ba0
parent 3f2983684499156ccb8a7a8726930ac4d28b4dfd
Author: Drew DeVault <sir@cmpwn.com>
Date: Thu, 14 Apr 2022 14:47:10 +0200
nl: fix invalid error propagation
Diffstat:
M | nl.ha | | | 14 | +++++++------- |
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/nl.ha b/nl.ha
@@ -238,28 +238,28 @@ fn println(line: str, style: style, ctx: *context) void = {
switch (style) {
case style::ALL =>
if (!isblank(line)) {
- fmt::printf("{%}", ctx.linenum, ctx.mod)?;
- fmt::print(ctx.sep)?;
+ fmt::printf("{%}", ctx.linenum, ctx.mod)!;
+ fmt::print(ctx.sep)!;
ctx.linenum += ctx.incr;
ctx.conblanks = 0;
} else {
ctx.conblanks += 1;
if (ctx.conblanks == ctx.maxblanks) {
- fmt::printf("{%}", ctx.linenum, ctx.mod)?;
- fmt::print(ctx.sep)?;
+ fmt::printf("{%}", ctx.linenum, ctx.mod)!;
+ fmt::print(ctx.sep)!;
ctx.linenum += ctx.incr;
ctx.conblanks = 0;
};
};
case style::TXT =>
if (!isblank(line)) {
- fmt::printf("{%}", ctx.linenum, ctx.mod)?;
- fmt::print(ctx.sep)?;
+ fmt::printf("{%}", ctx.linenum, ctx.mod)!;
+ fmt::print(ctx.sep)!;
ctx.linenum += ctx.incr;
};
case style::NON => void;
};
- fmt::println(line)?;
+ fmt::println(line)!;
};
fn isblank(line: str) bool = {