From ba12cb80f5ac40c614c1ada71a8ec48d3f7499f8 Mon Sep 17 00:00:00 2001 From: Avery Winters Date: Thu, 24 Oct 2024 13:45:07 -0500 Subject: [PATCH] Remove redundant closure --- rust/beer-song/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/beer-song/src/lib.rs b/rust/beer-song/src/lib.rs index 155fdbc..1dbe7dc 100644 --- a/rust/beer-song/src/lib.rs +++ b/rust/beer-song/src/lib.rs @@ -22,6 +22,6 @@ pub fn verse(n: u32) -> String { pub fn sing(start: u32, end: u32) -> String { // Once it is stable, use `Iterator::intersperse` here to skip the temporary // `Vec`: https://github.com/rust-lang/rust/issues/79524 - let verses: Vec<_> = (end..=start).rev().map(|n| verse(n)).collect(); + let verses: Vec<_> = (end..=start).rev().map(verse).collect(); verses.join("\n\n") }