fmt, clippy, and Category change

This commit is contained in:
NotTheDr01ds
2024-11-12 15:05:45 -05:00
parent 192e6dc3a7
commit 139703f0df
3 changed files with 6 additions and 5 deletions

View File

@ -18,7 +18,7 @@ impl Command for SubCommand {
(Type::String, Type::record()), (Type::String, Type::record()),
]) ])
.allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032 .allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032
.category(Category::Date) .category(Category::Deprecated)
} }
fn description(&self) -> &str { fn description(&self) -> &str {
@ -36,10 +36,9 @@ impl Command for SubCommand {
call: &Call, call: &Call,
input: PipelineData, input: PipelineData,
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let head = call.head; let head = call.head;
report_parse_warning( report_parse_warning(
&StateWorkingSet::new(&engine_state), &StateWorkingSet::new(engine_state),
&ParseWarning::DeprecatedWarning { &ParseWarning::DeprecatedWarning {
old_command: "date to-record".into(), old_command: "date to-record".into(),
new_suggestion: "see `into record` command examples".into(), new_suggestion: "see `into record` command examples".into(),

View File

@ -18,7 +18,7 @@ impl Command for SubCommand {
(Type::String, Type::table()), (Type::String, Type::table()),
]) ])
.allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032 .allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032
.category(Category::Date) .category(Category::Deprecated)
} }
fn description(&self) -> &str { fn description(&self) -> &str {
@ -38,7 +38,7 @@ impl Command for SubCommand {
) -> Result<PipelineData, ShellError> { ) -> Result<PipelineData, ShellError> {
let head = call.head; let head = call.head;
report_parse_warning( report_parse_warning(
&StateWorkingSet::new(&engine_state), &StateWorkingSet::new(engine_state),
&ParseWarning::DeprecatedWarning { &ParseWarning::DeprecatedWarning {
old_command: "date to-table".into(), old_command: "date to-table".into(),
new_suggestion: "see `into record` command examples".into(), new_suggestion: "see `into record` command examples".into(),

View File

@ -44,6 +44,7 @@ pub enum Category {
Date, Date,
Debug, Debug,
Default, Default,
Deprecated,
Removed, Removed,
Env, Env,
Experimental, Experimental,
@ -79,6 +80,7 @@ impl std::fmt::Display for Category {
Category::Date => "date", Category::Date => "date",
Category::Debug => "debug", Category::Debug => "debug",
Category::Default => "default", Category::Default => "default",
Category::Deprecated => "deprecated",
Category::Removed => "removed", Category::Removed => "removed",
Category::Env => "env", Category::Env => "env",
Category::Experimental => "experimental", Category::Experimental => "experimental",