Don't print double newline for --show
This commit is contained in:
parent
c4f87b7e77
commit
bd8b12db93
@ -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