mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 12:25:58 +02:00
Fix clippy (#15489)
# Description There are some clippy(version 0.1.86) errors on nushell repo. This pr is trying to fix it. # User-Facing Changes Hopefully none. # Tests + Formatting NaN # After Submitting NaN
This commit is contained in:
@ -884,7 +884,7 @@ impl<'a> StateWorkingSet<'a> {
|
||||
.active_overlay_names(&mut removed_overlays)
|
||||
.iter()
|
||||
.rev()
|
||||
.last()
|
||||
.next_back()
|
||||
{
|
||||
return last_name;
|
||||
}
|
||||
@ -900,7 +900,7 @@ impl<'a> StateWorkingSet<'a> {
|
||||
if let Some(last_overlay) = scope_frame
|
||||
.active_overlays(&mut removed_overlays)
|
||||
.rev()
|
||||
.last()
|
||||
.next_back()
|
||||
{
|
||||
return last_overlay;
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ pub fn lev_distance_with_substrings(a: &str, b: &str, limit: usize) -> Option<us
|
||||
1 // Exact substring match, but not a total word match so return non-zero
|
||||
} else if !big_len_diff {
|
||||
// Not a big difference in length, discount cost of length difference
|
||||
score + (len_diff + 1) / 2
|
||||
score + len_diff.div_ceil(2)
|
||||
} else {
|
||||
// A big difference in length, add back the difference in length to the score
|
||||
score + len_diff
|
||||
|
@ -133,7 +133,7 @@ pub trait FromValue: Sized {
|
||||
Type::Custom(
|
||||
any::type_name::<Self>()
|
||||
.split(':')
|
||||
.last()
|
||||
.next_back()
|
||||
.expect("str::split returns an iterator with at least one element")
|
||||
.to_string()
|
||||
.into_boxed_str(),
|
||||
|
Reference in New Issue
Block a user