willothy / worth

Found occurrence of .nth(0) RS-W1053
Anti-pattern
Minor
a year agoa year old
Called .nth(0) when .next() would suffice
 14    let Some(contents) = std::fs::read_to_string(file).ok() else {
 15        return None;
 16    };
 17    let args: Vec<String> = snailquote::escape(contents.lines().nth(0).unwrap()) 18        .split_whitespace()
 19        .map(|x| x.to_string())
 20        .collect();