mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
clippy: fix map_clone lint
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
use clap::Command;
|
||||
use coreutils::validation;
|
||||
use itertools::Itertools as _;
|
||||
use std::cmp;
|
||||
use std::ffi::OsString;
|
||||
use std::io::{self, Write};
|
||||
@@ -28,10 +29,7 @@ fn usage<T>(utils: &UtilityMap<T>, name: &str) {
|
||||
println!("Options:");
|
||||
println!(" --list lists all defined functions, one per row\n");
|
||||
println!("Currently defined functions:\n");
|
||||
#[allow(clippy::map_clone)]
|
||||
let mut utils: Vec<&str> = utils.keys().map(|&s| s).collect();
|
||||
utils.sort_unstable();
|
||||
let display_list = utils.join(", ");
|
||||
let display_list = utils.keys().copied().sorted_unstable().join(", ");
|
||||
let width = cmp::min(textwrap::termwidth(), 100) - 4 * 2; // (opinion/heuristic) max 100 chars wide with 4 character side indentions
|
||||
println!(
|
||||
"{}",
|
||||
|
||||
Reference in New Issue
Block a user