From 0a78bcfd55e46e5d5285ebb1c80d98d73467f459 Mon Sep 17 00:00:00 2001 From: Avril Date: Mon, 4 Apr 2022 22:00:19 +0100 Subject: [PATCH] TODO: collect_input(): Use non-panicking functions for getting args/lines (so in release builds, no panic handler is generated) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for reverse's current commit: Half curse − 半凶 --- Cargo.lock | 2 +- src/main.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 41c1ff6..a6c97d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,4 +4,4 @@ version = 3 [[package]] name = "reverse" -version = "0.2.0" +version = "0.2.1" diff --git a/src/main.rs b/src/main.rs index 928b278..6089abf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,6 +30,7 @@ fn binsearch<'a, V: ?Sized, T: PartialEq + 'a>(slice: &'a [T], find: &V) -> O fn collect_input() -> Box + 'static> { + //! TODO: Use non-panicking functions for both reading lines and reading args, just skip invalid lines/args if std::env::args_os().len() <= 1 { use std::io::{ self, @@ -73,6 +74,7 @@ fn main() { for x in args.iter() { handle_fmt_err({ if cfg!(feature="output-quoted") { + //XXX: This doesn't flush, right? It shouldn't, but maybe we should test it? writeln!(&mut out, "{:?}", x) } else {