From c5c58c86b9c503d8de19da356a5a5cffb59fbe84 Mon Sep 17 00:00:00 2001 From: Kevin K Date: Thu, 10 Mar 2016 16:36:23 -0500 Subject: [PATCH] fix(From Usage): fixes a bug where adding empty lines werent ignored --- src/app/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/mod.rs b/src/app/mod.rs index e915e256e76..cd252ed1f41 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -428,9 +428,10 @@ impl<'a, 'b> App<'a, 'b> { /// # ; /// ``` pub fn args_from_usage(mut self, usage: &'a str) -> Self { - for l in usage.lines() { - if l.len() == 0 { continue; } - self.p.add_arg(&Arg::from_usage(l.trim())); + for line in usage.lines() { + let l = line.trim(); + if l.is_empty() { continue; } + self.p.add_arg(&Arg::from_usage(l)); } self }