mirror of
https://github.com/nushell/nushell.git
synced 2025-05-30 14:50:02 +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![]);
|
return mk_shape(vec![]);
|
||||||
};
|
};
|
||||||
|
|
||||||
let key_bytes = working_set.get_span_contents(tokens[idx].span).to_vec();
|
if working_set
|
||||||
if key_bytes.first().copied() == Some(b',') {
|
.get_span_contents(tokens[idx].span)
|
||||||
|
.starts_with(b",")
|
||||||
|
{
|
||||||
idx += 1;
|
idx += 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -205,8 +207,8 @@ fn parse_collection_shape(
|
|||||||
idx += 1;
|
idx += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
let maybe_colon = working_set.get_span_contents(tokens[idx].span).to_vec();
|
let maybe_colon = working_set.get_span_contents(tokens[idx].span);
|
||||||
match maybe_colon.as_slice() {
|
match maybe_colon {
|
||||||
b":" => {
|
b":" => {
|
||||||
if idx + 1 == tokens.len() {
|
if idx + 1 == tokens.len() {
|
||||||
working_set
|
working_set
|
||||||
|
Loading…
x
Reference in New Issue
Block a user