mirror of
https://github.com/nushell/nushell.git
synced 2025-01-22 22:29:10 +01:00
Clippy fixes
This commit is contained in:
parent
946da5ea5f
commit
8e16bb6469
@ -177,12 +177,12 @@ fn map_value(input: &Value, args: &Arguments, head: Span) -> Value {
|
|||||||
|
|
||||||
fn resolve_relative_range(range: &Subbytes, len: &usize) -> (usize, usize) {
|
fn resolve_relative_range(range: &Subbytes, len: &usize) -> (usize, usize) {
|
||||||
let start = match range.0 {
|
let start = match range.0 {
|
||||||
start if start < 0 => len.checked_sub(start.abs() as usize).unwrap_or(0),
|
start if start < 0 => len.checked_sub(start.unsigned_abs()).unwrap_or(0),
|
||||||
start => start as usize,
|
start => start as usize,
|
||||||
};
|
};
|
||||||
|
|
||||||
let end = match range.1 {
|
let end = match range.1 {
|
||||||
end if end < 0 => len.checked_sub(end.abs() as usize).unwrap_or(0),
|
end if end < 0 => len.checked_sub(end.unsigned_abs()).unwrap_or(0),
|
||||||
end => end as usize,
|
end => end as usize,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user