mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 02:55:07 +02:00
Add "move column" command. (#2123)
This commit is contained in:
committed by
GitHub
parent
c3ba1e476f
commit
34e1e6e426
@ -61,6 +61,11 @@ impl ColumnPath {
|
||||
pub fn split_last(&self) -> Option<(&PathMember, &[PathMember])> {
|
||||
self.members.split_last()
|
||||
}
|
||||
|
||||
/// Returns the last member
|
||||
pub fn last(&self) -> Option<&PathMember> {
|
||||
self.iter().last()
|
||||
}
|
||||
}
|
||||
|
||||
impl PrettyDebug for ColumnPath {
|
||||
@ -99,6 +104,13 @@ impl PathMember {
|
||||
pub fn int(int: impl Into<BigInt>, span: impl Into<Span>) -> PathMember {
|
||||
UnspannedPathMember::Int(int.into()).into_path_member(span)
|
||||
}
|
||||
|
||||
pub fn as_string(&self) -> String {
|
||||
match &self.unspanned {
|
||||
UnspannedPathMember::String(string) => string.clone(),
|
||||
UnspannedPathMember::Int(int) => format!("{}", int),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Prepares a list of "sounds like" matches for the string you're trying to find
|
||||
|
Reference in New Issue
Block a user