summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-01-13 09:42:00 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-01-15 23:21:39 +0100
commita1b3ecc51b53bb6a95f943bd4b6466cfb9b5330f (patch)
treecf248fec34c99d82685c22317450cd4d5ae418cf /src
parentbde6b8ad64b3f34480a751e7816d57660a09a4a5 (diff)
Fix clippy: `.map().collect()` can be replaced with `.try_for_each()`
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src')
-rw-r--r--src/commands/source.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/commands/source.rs b/src/commands/source.rs
index efb45bc..ea423bb 100644
--- a/src/commands/source.rs
+++ b/src/commands/source.rs
@@ -140,13 +140,14 @@ pub async fn url(matches: &ArgMatches, repo: Repository) -> Result<()> {
repo.packages()
.filter(|p| pname.as_ref().map(|n| p.name() == n).unwrap_or(true))
.filter(|p| pvers.as_ref().map(|v| v.matches(p.version())).unwrap_or(true))
- .map(|p| {
+ .try_for_each(|p| {
p.sources()
.iter()
- .map(|(source_name, source)| writeln!(outlock, "{} {} -> {} = {}", p.name(), p.version(), source_name, source.url()).map_err(Error::from))
- .collect()
+ .try_for_each(|(source_name, source)| {
+ writeln!(outlock, "{} {} -> {} = {}", p.name(), p.version(), source_name, source.url())
+ .map_err(Error::from)
+ })
})
- .collect()
}
pub async fn download(matches: &ArgMatches, config: &Configuration, repo: Repository, progressbars: ProgressBars) -> Result<()> {