mirror of
https://github.com/nushell/nushell.git
synced 2024-10-18 00:04:34 +02:00
23 lines
518 B
Rust
23 lines
518 B
Rust
use crate::object::{Primitive, Value};
|
|
use crate::prelude::*;
|
|
|
|
impl From<Primitive> for Value {
|
|
fn from(input: Primitive) -> Value {
|
|
Value::Primitive(input)
|
|
}
|
|
}
|
|
|
|
impl From<String> for Value {
|
|
fn from(input: String) -> Value {
|
|
Value::Primitive(Primitive::String(input))
|
|
}
|
|
}
|
|
|
|
impl<T: Into<Value>> Tagged<T> {
|
|
pub fn into_tagged_value(self) -> Tagged<Value> {
|
|
let value_span = self.span();
|
|
let value = self.item.into();
|
|
value.simple_spanned(value_span)
|
|
}
|
|
}
|