mirror of
https://github.com/nushell/nushell.git
synced 2025-08-20 02:28:41 +02:00
Fix clippy lints (#2651)
This commit is contained in:
@@ -10,25 +10,16 @@ pub enum AutoPivotMode {
|
||||
|
||||
impl AutoPivotMode {
|
||||
pub fn is_auto(&self) -> bool {
|
||||
match &self {
|
||||
AutoPivotMode::Auto => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, AutoPivotMode::Auto)
|
||||
}
|
||||
|
||||
pub fn is_always(&self) -> bool {
|
||||
match &self {
|
||||
AutoPivotMode::Always => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, AutoPivotMode::Always)
|
||||
}
|
||||
|
||||
#[allow(unused)]
|
||||
pub fn is_never(&self) -> bool {
|
||||
match &self {
|
||||
AutoPivotMode::Never => true,
|
||||
_ => false,
|
||||
}
|
||||
matches!(self, AutoPivotMode::Never)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ fn parse_aligned_columns<'a>(
|
||||
.flat_map(|s| find_indices(*s))
|
||||
.collect::<Vec<usize>>();
|
||||
|
||||
indices.sort();
|
||||
indices.sort_unstable();
|
||||
indices.dedup();
|
||||
|
||||
let headers: Vec<(String, usize)> = indices
|
||||
|
||||
@@ -218,17 +218,13 @@ fn move_after(
|
||||
));
|
||||
};
|
||||
|
||||
let columns_moved = table
|
||||
.data_descriptors()
|
||||
.into_iter()
|
||||
.map(|name| {
|
||||
if columns.contains(&name) {
|
||||
None
|
||||
} else {
|
||||
Some(name)
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
let columns_moved = table.data_descriptors().into_iter().map(|name| {
|
||||
if columns.contains(&name) {
|
||||
None
|
||||
} else {
|
||||
Some(name)
|
||||
}
|
||||
});
|
||||
|
||||
let mut reordered_columns = vec![];
|
||||
let mut insert = false;
|
||||
@@ -281,17 +277,13 @@ fn move_before(
|
||||
));
|
||||
};
|
||||
|
||||
let columns_moved = table
|
||||
.data_descriptors()
|
||||
.into_iter()
|
||||
.map(|name| {
|
||||
if columns.contains(&name) {
|
||||
None
|
||||
} else {
|
||||
Some(name)
|
||||
}
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
let columns_moved = table.data_descriptors().into_iter().map(|name| {
|
||||
if columns.contains(&name) {
|
||||
None
|
||||
} else {
|
||||
Some(name)
|
||||
}
|
||||
});
|
||||
|
||||
let mut reordered_columns = vec![];
|
||||
let mut inserted = false;
|
||||
|
||||
Reference in New Issue
Block a user