diff --git a/src/cli/init.rs b/src/cli/init.rs index 3ae24707c8..e987cc8a13 100644 --- a/src/cli/init.rs +++ b/src/cli/init.rs @@ -193,22 +193,13 @@ pub async fn execute(args: Args) -> miette::Result<()> { name ); // Inform about the addition of environments from extras (if any) - let envs = environments - .keys() - .map(AsRef::as_ref) - .collect::>(); - if envs.len() > 1 { + if !environments.is_empty() { + let envs: Vec<&str> = environments.keys().map(AsRef::as_ref).collect(); eprintln!( - "{}Added environments {} from optional extras.", + "{}Added environment(s) {} from optional extras.", console::style(console::Emoji("✔ ", "")).green(), format!("'{}'", envs.join("', '")) ) - } else if envs.len() == 1 { - eprintln!( - "{}Added environment {} from optional extras.", - console::style(console::Emoji("✔ ", "")).green(), - format!("'{}'", envs[0]) - ) } } }