Remove the line primitive (#2887)

This commit is contained in:
Jonathan Turner
2021-01-08 14:45:25 +13:00
committed by GitHub
parent eb3c2c9e76
commit ac9909112f
40 changed files with 26 additions and 153 deletions

View File

@ -146,9 +146,6 @@ pub fn coerce_compare_primitive(
}
(Nothing, Nothing) => CompareValues::Booleans(true, true),
(String(left), String(right)) => CompareValues::String(left.clone(), right.clone()),
(Line(left), String(right)) => CompareValues::String(left.clone(), right.clone()),
(String(left), Line(right)) => CompareValues::String(left.clone(), right.clone()),
(Line(left), Line(right)) => CompareValues::String(left.clone(), right.clone()),
(Date(left), Date(right)) => CompareValues::Date(*left, *right),
(Date(left), Duration(right)) => CompareValues::DateDuration(*left, right.clone()),
(Boolean(left), Boolean(right)) => CompareValues::Booleans(*left, *right),

View File

@ -71,7 +71,6 @@ impl InlineShape {
Primitive::Decimal(decimal) => InlineShape::Decimal(decimal.clone()),
Primitive::Filesize(bytesize) => InlineShape::Bytesize(*bytesize),
Primitive::String(string) => InlineShape::String(string.clone()),
Primitive::Line(string) => InlineShape::Line(string.clone()),
Primitive::ColumnPath(path) => InlineShape::ColumnPath(path.clone()),
Primitive::Pattern(pattern) => InlineShape::Pattern(pattern.clone()),
Primitive::Boolean(boolean) => InlineShape::Boolean(*boolean),

View File

@ -83,7 +83,6 @@ fn helper(v: &Value) -> Result<toml::Value, ShellError> {
}
UntaggedValue::Primitive(Primitive::Pattern(s)) => toml::Value::String(s.clone()),
UntaggedValue::Primitive(Primitive::String(s)) => toml::Value::String(s.clone()),
UntaggedValue::Primitive(Primitive::Line(s)) => toml::Value::String(s.clone()),
UntaggedValue::Primitive(Primitive::Path(s)) => {
toml::Value::String(s.display().to_string())
}

View File

@ -81,10 +81,6 @@ impl ExtractType for String {
value: UntaggedValue::Primitive(Primitive::String(string)),
..
} => Ok(string.clone()),
Value {
value: UntaggedValue::Primitive(Primitive::Line(string)),
..
} => Ok(string.clone()),
other => Err(ShellError::type_error("String", other.spanned_type_name())),
}
}