From 318473c5fe91f1b926e2888d81278de7482e9621 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Fri, 14 Apr 2023 00:23:16 +0200 Subject: [PATCH] Clever iterators --- src/library/beets.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/library/beets.rs b/src/library/beets.rs index ee6bf88..e7ad1db 100644 --- a/src/library/beets.rs +++ b/src/library/beets.rs @@ -69,13 +69,8 @@ impl ToBeetsArgs for Query { fn to_args(&self) -> Vec { let mut arguments: Vec = vec![]; - for field in self.include.iter() { - arguments.push(field.to_arg(true)); - } - - for field in self.exclude.iter() { - arguments.push(field.to_arg(false)); - } + arguments.extend(self.include.iter().map(|field| field.to_arg(true))); + arguments.extend(self.exclude.iter().map(|field| field.to_arg(false))); arguments }