mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Extract nu_source into a crate
This commit extracts Tag, Span, Text, as well as source-related debug facilities into a new crate called nu_source. This change is much bigger than one might have expected because the previous code relied heavily on implementing inherent methods on `Tagged<T>` and `Spanned<T>`, which is no longer possible. As a result, this change creates more concrete types instead of using `Tagged<T>`. One notable example: Tagged<Value> became Value, and Value became UntaggedValue. This change clarifies the intent of the code in many places, but it does make it a big change.
This commit is contained in:
@ -36,14 +36,14 @@ fn shells(args: CommandArgs, _registry: &CommandRegistry) -> Result<OutputStream
|
||||
let mut dict = TaggedDictBuilder::new(&tag);
|
||||
|
||||
if index == (*args.shell_manager.current_shell).load(Ordering::SeqCst) {
|
||||
dict.insert(" ", "X".to_string());
|
||||
dict.insert_untagged(" ", "X".to_string());
|
||||
} else {
|
||||
dict.insert(" ", " ".to_string());
|
||||
dict.insert_untagged(" ", " ".to_string());
|
||||
}
|
||||
dict.insert("name", shell.name());
|
||||
dict.insert("path", shell.path());
|
||||
dict.insert_untagged("name", shell.name());
|
||||
dict.insert_untagged("path", shell.path());
|
||||
|
||||
shells_out.push_back(dict.into_tagged_value());
|
||||
shells_out.push_back(dict.into_value());
|
||||
}
|
||||
|
||||
Ok(shells_out.to_output_stream())
|
||||
|
Reference in New Issue
Block a user