mirror of
https://seed.radicle.dev/rad:z39mP9rQAaGmERfUMPULfPUi473tY.git
synced 2026-11-21 10:30:48 +08:00
bin/issue: Optimize collecting of patches into Vec
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
committed by
Erik Kundt
parent
d3dcfd8e09
commit
be0ba80140
@@ -226,16 +226,15 @@ pub async fn run(options: Options, ctx: impl terminal::Context) -> anyhow::Resul
|
||||
|
||||
eprint!("{selection}");
|
||||
} else if let Some(selection) = selection {
|
||||
let mut args = vec![];
|
||||
let args = [
|
||||
selection.operation.as_ref().cloned(),
|
||||
selection.ids.first().map(ToString::to_string),
|
||||
]
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.map(OsString::from)
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
if let Some(operation) = selection.operation {
|
||||
args.push(operation.to_string());
|
||||
}
|
||||
if let Some(id) = selection.ids.first() {
|
||||
args.push(format!("{id}"));
|
||||
}
|
||||
|
||||
let args = args.into_iter().map(OsString::from).collect::<Vec<_>>();
|
||||
let _ = crate::terminal::run_rad(Some("issue"), &args);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user