mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 16:15:20 +02:00
Move command changes. Refactorings. (#2683)
Continuing on anchoring and improvements on Nu's overall internal commands (#2635). `move column` sub command has been turned into the command `move` since we use it to move exclusively columns. Examples added as well. Fixed it to carry along any anchor locations that might be in place if table to be moved originates from other sources.
This commit is contained in:
committed by
GitHub
parent
bc6c884a14
commit
b6d19cc9fa
@ -24,3 +24,12 @@ macro_rules! outln {
|
||||
macro_rules! errln {
|
||||
($($tokens:tt)*) => { eprintln!($($tokens)*) }
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! row {
|
||||
($( $key: expr => $val: expr ),*) => {{
|
||||
let mut map = ::indexmap::IndexMap::new();
|
||||
$( map.insert($key, $val); )*
|
||||
::nu_protocol::UntaggedValue::row(map).into_untagged_value()
|
||||
}}
|
||||
}
|
||||
|
@ -169,8 +169,8 @@ impl UntaggedValue {
|
||||
}
|
||||
|
||||
/// Helper for creating column-path values
|
||||
pub fn column_path(s: &str) -> UntaggedValue {
|
||||
let s = s.to_string().spanned_unknown();
|
||||
pub fn column_path(s: &str, span: Span) -> UntaggedValue {
|
||||
let s = s.to_string().spanned(span);
|
||||
|
||||
UntaggedValue::Primitive(Primitive::ColumnPath(ColumnPath::build(&s)))
|
||||
}
|
||||
@ -196,8 +196,8 @@ impl UntaggedValue {
|
||||
}
|
||||
|
||||
/// Helper for creating decimal values
|
||||
pub fn decimal(s: BigDecimal) -> UntaggedValue {
|
||||
UntaggedValue::Primitive(Primitive::Decimal(s))
|
||||
pub fn decimal(s: impl Into<BigDecimal>) -> UntaggedValue {
|
||||
UntaggedValue::Primitive(Primitive::Decimal(s.into()))
|
||||
}
|
||||
|
||||
/// Helper for creating decimal values
|
||||
|
Reference in New Issue
Block a user