have Session::finish() use iter_join for better efficiency
This commit is contained in:
parent
580b972f45
commit
660e4b1668
1 changed files with 1 additions and 8 deletions
|
|
@ -216,14 +216,7 @@ impl<'a, T: Read + Write> AppendCmd<'a, T> {
|
|||
/// Note: be sure to set flags and optional date before you
|
||||
/// finish the command.
|
||||
pub fn finish(&mut self) -> Result<Appended> {
|
||||
let flagstr = self
|
||||
.flags
|
||||
.clone()
|
||||
.into_iter()
|
||||
.filter(|f| *f != Flag::Recent)
|
||||
.map(|f| f.to_string())
|
||||
.collect::<Vec<String>>()
|
||||
.join(" ");
|
||||
let flagstr = iter_join(self.flags.iter().filter(|f| **f != Flag::Recent), " ");
|
||||
|
||||
let datestr = if let Some(date) = self.date {
|
||||
format!(" \"{}\"", date.format("%d-%h-%Y %T %z"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue