mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 09:45:50 +02:00
Use slices directly instead of &Vec
(#10328)
Simplifies the signature, makes it more flexible. Detected a few unnecessary allocations in the process.
This commit is contained in:
committed by
GitHub
parent
84c10de864
commit
e90b099622
@ -19,10 +19,10 @@ pub fn get_columns(input: &[Value]) -> Vec<String> {
|
||||
}
|
||||
|
||||
// If a column doesn't exist in the input, return it.
|
||||
pub fn nonexistent_column(inputs: Vec<String>, columns: Vec<String>) -> Option<String> {
|
||||
pub fn nonexistent_column(inputs: &[String], columns: &[String]) -> Option<String> {
|
||||
let set: HashSet<String> = HashSet::from_iter(columns.iter().cloned());
|
||||
|
||||
for input in &inputs {
|
||||
for input in inputs {
|
||||
if set.contains(input) {
|
||||
continue;
|
||||
}
|
||||
|
Reference in New Issue
Block a user