From 312432a5dbf0073eea32972e8309c35cf8b8ef14 Mon Sep 17 00:00:00 2001 From: CreepySkeleton Date: Sun, 26 Apr 2020 20:42:21 +0300 Subject: [PATCH] Fix a bug we didn't know about --- src/parse/validator.rs | 3 ++- src/util/termcolor.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/parse/validator.rs b/src/parse/validator.rs index 3fd1e0cd..c93ba8d7 100644 --- a/src/parse/validator.rs +++ b/src/parse/validator.rs @@ -276,7 +276,7 @@ impl<'b, 'c, 'z> Validator<'b, 'c, 'z> { fn gather_conflicts(&mut self, matcher: &mut ArgMatcher) { debug!("Validator::gather_conflicts"); for name in matcher.arg_names() { - debug!("Validator::gather_conflicts:iter:{:?}", name); + debug!("Validator::gather_conflicts:iter: id={:?}", name); // if arg is "present" only because it got default value // it doesn't conflict with anything // @@ -285,6 +285,7 @@ impl<'b, 'c, 'z> Validator<'b, 'c, 'z> { .get(name) .map_or(false, |a| a.ty == ValueType::DefaultValue) { + debug!("Validator::gather_conflicts:iter: This is default value, skipping.",); continue; } diff --git a/src/util/termcolor.rs b/src/util/termcolor.rs index 9aff9c2c..680e7fc8 100644 --- a/src/util/termcolor.rs +++ b/src/util/termcolor.rs @@ -28,9 +28,9 @@ impl BufferWriter { pub(crate) fn print(&self, buf: &Buffer) -> Result<()> { if self.use_stderr { - stderr().lock().write(buf)?; + stderr().lock().write_all(buf)?; } else { - stdout().lock().write(buf)?; + stdout().lock().write_all(buf)?; } Ok(())