From 293d0b830ce403e109243774f10f80d7cd87b7bd Mon Sep 17 00:00:00 2001 From: ugla Date: Sun, 24 Apr 2022 17:12:29 +0200 Subject: [PATCH] Return unsuccess if no matches --- src/main.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.zig b/src/main.zig index cae962d..29d9eea 100644 --- a/src/main.zig +++ b/src/main.zig @@ -16,6 +16,10 @@ pub fn main() anyerror!void { needle[i] = badToUpper(c); try writeMatches(buff_writer, needle); + + if (buffered.fifo.count == 0) + return error.NoMatches; + try buffered.flush(); } -- 2.45.2