mirror of
https://github.com/nushell/nushell
synced 2024-11-14 17:07:07 +00:00
Remove cargo culted latest_tag that is not needed for from_bson
This commit is contained in:
parent
e9673c31ea
commit
b0d7daa0d6
1 changed files with 2 additions and 3 deletions
|
@ -174,18 +174,17 @@ fn from_bson(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStre
|
||||||
|
|
||||||
for value in values {
|
for value in values {
|
||||||
let value_tag = value.tag();
|
let value_tag = value.tag();
|
||||||
let latest_tag = Some(value_tag);
|
|
||||||
match value.item {
|
match value.item {
|
||||||
Value::Binary(vb) =>
|
Value::Binary(vb) =>
|
||||||
match from_bson_bytes_to_value(vb, span) {
|
match from_bson_bytes_to_value(vb, span) {
|
||||||
Ok(x) => yield ReturnSuccess::value(x),
|
Ok(x) => yield ReturnSuccess::value(x),
|
||||||
Err(_) => if let Some(last_tag) = latest_tag {
|
Err(_) => {
|
||||||
yield Err(ShellError::labeled_error_with_secondary(
|
yield Err(ShellError::labeled_error_with_secondary(
|
||||||
"Could not parse as BSON",
|
"Could not parse as BSON",
|
||||||
"input cannot be parsed as BSON",
|
"input cannot be parsed as BSON",
|
||||||
span,
|
span,
|
||||||
"value originates from here",
|
"value originates from here",
|
||||||
last_tag.span,
|
value_tag.span,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue