Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions src/commands/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,13 @@ impl TemplateNewCommandCore {

let (name, template_id) = self.resolve_name_template_syntax(&template_manager, &variant)?;

let template = match &template_id {
let template = match template_id {
Some(template_id) => match template_manager
.get(template_id)
.get(&template_id)
.with_context(|| format!("Error retrieving template {template_id}"))?
{
Some(template) => template,
None => match prompt_template(&template_manager, &variant, &[template_id.clone()])
Copy link
Collaborator Author

@lann lann Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clippy wanted to use some fancy std::slice::from_ref malarkey to avoid this clone but I showed it what for.

.await?
{
None => match prompt_template(&template_manager, &variant, &[template_id]).await? {
Some(template) => template,
None => return Ok(()),
},
Expand Down
Loading