mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Clippy fix for Rust 1.63 (#6299)
Take more sensitive lints into account Somewhat ugly in some cases is the replacement of `.get(0)` with `.first()`
This commit is contained in:
committed by
GitHub
parent
08c98967e0
commit
c2f4969d4f
@ -217,7 +217,7 @@ fn process_range(
|
||||
Value::String { val: s, .. } => {
|
||||
let indexes: Vec<&str> = s.split(',').collect();
|
||||
|
||||
let start_index = indexes.get(0).unwrap_or(&&min_index_str[..]).to_string();
|
||||
let start_index = indexes.first().unwrap_or(&&min_index_str[..]).to_string();
|
||||
|
||||
let end_index = indexes.get(1).unwrap_or(&&max_index_str[..]).to_string();
|
||||
|
||||
|
@ -247,7 +247,7 @@ fn process_arguments(options: &Arguments, head: Span) -> Result<(isize, isize),
|
||||
let idx: Vec<&str> = val.split(',').collect();
|
||||
|
||||
let start = idx
|
||||
.get(0)
|
||||
.first()
|
||||
.ok_or_else(|| {
|
||||
ShellError::UnsupportedInput("could not perform substring".to_string(), head)
|
||||
})?
|
||||
|
Reference in New Issue
Block a user