mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 08:31:29 +02:00
Fix signatures for cellpath access of records (#9793)
# Description The same procedure as for #9778 repeated for records. # User-Facing Changes Commands that directly supported applying their work directly to record fields via cell paths, that worked before #9680 will now work again # Tests + Formatting Tried to limit the need to add new `.allow_variants_without_examples()` by adjusting or adding tests to also use some records with access.
This commit is contained in:
committed by
GitHub
parent
f8d325dbfe
commit
d9230a76f3
@@ -36,6 +36,7 @@ impl Command for SubCommand {
|
||||
(Type::Filesize, Type::Binary),
|
||||
(Type::Date, Type::Binary),
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true) // TODO: supply exhaustive examples
|
||||
.rest(
|
||||
|
@@ -23,6 +23,7 @@ impl Command for SubCommand {
|
||||
(Type::Bool, Type::Bool),
|
||||
(Type::List(Box::new(Type::Any)), Type::Table(vec![])),
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.rest(
|
||||
|
@@ -69,6 +69,7 @@ impl Command for SubCommand {
|
||||
(Type::String, Type::Date),
|
||||
(Type::List(Box::new(Type::String)), Type::List(Box::new(Type::Date))),
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.named(
|
||||
|
@@ -21,6 +21,7 @@ impl Command for SubCommand {
|
||||
(Type::String, Type::Number),
|
||||
(Type::Bool, Type::Number),
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
(
|
||||
Type::List(Box::new(Type::Any)),
|
||||
Type::List(Box::new(Type::Number)),
|
||||
|
@@ -24,7 +24,9 @@ impl Command for SubCommand {
|
||||
(Type::String, Type::String),
|
||||
(Type::Duration, Type::String),
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true)
|
||||
.named(
|
||||
"convert",
|
||||
SyntaxShape::String,
|
||||
|
@@ -22,6 +22,7 @@ impl Command for SubCommand {
|
||||
(Type::String, Type::Filesize),
|
||||
(Type::Filesize, Type::Filesize),
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
(
|
||||
Type::List(Box::new(Type::Int)),
|
||||
Type::List(Box::new(Type::Filesize)),
|
||||
|
@@ -39,6 +39,7 @@ impl Command for SubCommand {
|
||||
(Type::Duration, Type::Int),
|
||||
(Type::Filesize, Type::Int),
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
(
|
||||
Type::List(Box::new(Type::String)),
|
||||
Type::List(Box::new(Type::Int)),
|
||||
|
@@ -45,6 +45,7 @@ impl Command for SubCommand {
|
||||
Type::List(Box::new(Type::String)),
|
||||
),
|
||||
(Type::Table(vec![]), Type::Table(vec![])),
|
||||
(Type::Record(vec![]), Type::Record(vec![])),
|
||||
])
|
||||
.allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032
|
||||
.rest(
|
||||
|
Reference in New Issue
Block a user