refactor: use extend instead of append

Co-authored-by: Jon Gjengset <jon@thesquareplanet.com>
This commit is contained in:
Michael Bøcker-Larsen 2020-12-21 10:37:18 +08:00 committed by GitHub
parent 74ef623fc5
commit 19af971c9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,8 +110,8 @@ impl<'a, T: Read + Write> AppendCmd<'a, T> {
}
/// Append an array of flags
pub fn flags(&mut self, flags: &'a [Flag<'a>]) -> &mut Self {
self.flags.append(&mut flags.to_vec());
pub fn flags(&mut self, flags: impl IntoIterator<Item = Flag<'a>>) -> &mut Self {
self.flags.extend(flags);
self
}