mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 03:27:45 +02:00
Fix quoted string handling
This commit is contained in:
@ -65,18 +65,16 @@ impl Item {
|
||||
Item::Operator(o) => Value::Primitive(Primitive::Operator(o.clone())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
crate fn print_items(items: &[Item]) -> String {
|
||||
let formatted = items.iter().map(|item| match item {
|
||||
Item::Bare(s) => format!("{}", s),
|
||||
Item::Quoted(s) => format!("{:?}", s),
|
||||
Item::Int(i) => format!("{:?}", i),
|
||||
Item::Boolean(b) => format!("{:?}", b),
|
||||
Item::Operator(o) => o.print(),
|
||||
});
|
||||
|
||||
itertools::join(formatted, " ")
|
||||
pub fn print(&self) -> String {
|
||||
match self {
|
||||
Item::Bare(s) => format!("{}", s),
|
||||
Item::Quoted(s) => format!("{}", s),
|
||||
Item::Int(i) => format!("{:?}", i),
|
||||
Item::Boolean(b) => format!("{:?}", b),
|
||||
Item::Operator(o) => o.print(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Item {
|
||||
|
Reference in New Issue
Block a user