aboutsummaryrefslogtreecommitdiff
path: root/mling/src/cli
diff options
context:
space:
mode:
Diffstat (limited to 'mling/src/cli')
-rw-r--r--mling/src/cli/list.rs4
-rw-r--r--mling/src/cli/namespace_mgr.rs8
-rw-r--r--mling/src/cli/read.rs4
3 files changed, 6 insertions, 10 deletions
diff --git a/mling/src/cli/list.rs b/mling/src/cli/list.rs
index faf1866..a0c68a0 100644
--- a/mling/src/cli/list.rs
+++ b/mling/src/cli/list.rs
@@ -109,9 +109,7 @@ fn print_list(title: String, list: Vec<String>, r: &mut RenderResult) {
r_println!("{}", title);
- let mut i = 1;
- for namespace in list.iter() {
+ for (i, namespace) in (1..).zip(list.iter()) {
r_println!(" {}. {}", i.to_string(), namespace.bold());
- i += 1;
}
}
diff --git a/mling/src/cli/namespace_mgr.rs b/mling/src/cli/namespace_mgr.rs
index 9781040..4f70c15 100644
--- a/mling/src/cli/namespace_mgr.rs
+++ b/mling/src/cli/namespace_mgr.rs
@@ -26,7 +26,7 @@ pub(crate) fn comp_trust(ctx: &ShellContext) -> Suggest {
return Suggest::Suggest(
list_namespaces(false, true, true)
.into_iter()
- .map(|i| SuggestItem::new(i))
+ .map(SuggestItem::new)
.collect::<std::collections::BTreeSet<_>>(),
);
}
@@ -39,7 +39,7 @@ pub(crate) fn comp_untrust(ctx: &ShellContext) -> Suggest {
return Suggest::Suggest(
list_namespaces(true, false, true)
.into_iter()
- .map(|i| SuggestItem::new(i))
+ .map(SuggestItem::new)
.collect::<std::collections::BTreeSet<_>>(),
);
}
@@ -61,7 +61,7 @@ pub(crate) fn comp_set_trust(ctx: &ShellContext) -> Suggest {
return Suggest::Suggest(
list_namespaces(true, true, true)
.into_iter()
- .map(|i| SuggestItem::new(i))
+ .map(SuggestItem::new)
.collect::<std::collections::BTreeSet<_>>(),
);
}
@@ -74,7 +74,7 @@ pub(crate) fn comp_remove_namespace(ctx: &ShellContext) -> Suggest {
return Suggest::Suggest(
list_namespaces(true, true, true)
.into_iter()
- .map(|i| SuggestItem::new(i))
+ .map(SuggestItem::new)
.collect::<std::collections::BTreeSet<_>>(),
);
}
diff --git a/mling/src/cli/read.rs b/mling/src/cli/read.rs
index 8717932..3bd9fc2 100644
--- a/mling/src/cli/read.rs
+++ b/mling/src/cli/read.rs
@@ -64,14 +64,12 @@ pub(crate) fn render_dir(prev: ResultDir) {
#[renderer]
pub(crate) fn render_binaries(prev: ResultBinaries) {
- let mut i = 1;
- for item in prev.bin.iter() {
+ for (i, item) in (1..).zip(prev.bin.iter()) {
r_println!(
"{}. {} ({})",
i.to_string(),
item.name.bold(),
item.path.to_string_lossy().underline().bright_cyan()
);
- i += 1;
}
}