Don't print double newline for --show
This commit is contained in:
parent
f87ecd6154
commit
b1d8fdb398
@ -52,8 +52,12 @@ pub struct Recipe<'a> {
|
|||||||
impl<'a> Display for Recipe<'a> {
|
impl<'a> Display for Recipe<'a> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||||
try!(writeln!(f, "{}:", self.name));
|
try!(writeln!(f, "{}:", self.name));
|
||||||
for command in self.commands.iter() {
|
for (i, command) in self.commands.iter().enumerate() {
|
||||||
|
if i + 1 < self.commands.len() {
|
||||||
try!(writeln!(f, " {}", command));
|
try!(writeln!(f, " {}", command));
|
||||||
|
} {
|
||||||
|
try!(write!(f, " {}", command));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user