mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 07:11:29 +02:00
Add select
This commit is contained in:
@@ -13,6 +13,24 @@ pub struct CellPath {
|
||||
pub members: Vec<PathMember>,
|
||||
}
|
||||
|
||||
impl CellPath {
|
||||
pub fn into_string(&self) -> String {
|
||||
let mut output = String::new();
|
||||
|
||||
for (idx, elem) in self.members.iter().enumerate() {
|
||||
if idx > 0 {
|
||||
output.push('.');
|
||||
}
|
||||
match elem {
|
||||
PathMember::Int { val, .. } => output.push_str(&format!("{}", val)),
|
||||
PathMember::String { val, .. } => output.push_str(val),
|
||||
}
|
||||
}
|
||||
|
||||
output
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct FullCellPath {
|
||||
pub head: Expression,
|
||||
|
Reference in New Issue
Block a user