Remove Span::unknown (#525)

This commit is contained in:
JT
2021-12-19 18:46:13 +11:00
committed by GitHub
parent b54e9b6bfd
commit 2883d6cd1e
183 changed files with 1291 additions and 1124 deletions

View File

@ -55,7 +55,7 @@ impl GStat {
}
None => Spanned {
item: ".".to_string(),
span: Span::unknown(),
span: *span,
},
};

View File

@ -1,6 +1,6 @@
use crate::GStat;
use nu_plugin::{EvaluatedCall, LabeledError, Plugin};
use nu_protocol::{Category, Signature, Span, Spanned, SyntaxShape, Value};
use nu_protocol::{Category, Signature, Spanned, SyntaxShape, Value};
impl Plugin for GStat {
fn signature(&self) -> Vec<Signature> {
@ -17,9 +17,7 @@ impl Plugin for GStat {
input: &Value,
) -> Result<Value, LabeledError> {
if name != "gstat" {
return Ok(Value::Nothing {
span: Span::unknown(),
});
return Ok(Value::Nothing { span: call.head });
}
let repo_path: Option<Spanned<String>> = call.opt(0)?;