mirror of
https://github.com/nushell/nushell.git
synced 2025-05-29 14:21:45 +02:00
avoid unnecessary clones
This commit is contained in:
parent
0389815137
commit
9976718363
@ -183,8 +183,10 @@ fn parse_collection_shape(
|
||||
return mk_shape(vec![]);
|
||||
};
|
||||
|
||||
let key_bytes = working_set.get_span_contents(tokens[idx].span).to_vec();
|
||||
if key_bytes.first().copied() == Some(b',') {
|
||||
if working_set
|
||||
.get_span_contents(tokens[idx].span)
|
||||
.starts_with(b",")
|
||||
{
|
||||
idx += 1;
|
||||
continue;
|
||||
}
|
||||
@ -205,8 +207,8 @@ fn parse_collection_shape(
|
||||
idx += 1;
|
||||
}
|
||||
|
||||
let maybe_colon = working_set.get_span_contents(tokens[idx].span).to_vec();
|
||||
match maybe_colon.as_slice() {
|
||||
let maybe_colon = working_set.get_span_contents(tokens[idx].span);
|
||||
match maybe_colon {
|
||||
b":" => {
|
||||
if idx + 1 == tokens.len() {
|
||||
working_set
|
||||
|
Loading…
x
Reference in New Issue
Block a user