From 6bbe5b6255e60d41b6070646029d045b7d95b598 Mon Sep 17 00:00:00 2001 From: Antoine Stevan <44101798+amtoine@users.noreply.github.com> Date: Thu, 4 May 2023 00:02:03 +0200 Subject: [PATCH] REFACTOR: move `source` out of deprecated commands (#9060) # Description the plan of deprecating `source` never really came to conclusion, so i propose to move it out of the deprecated commands in this PR. i've moved it to `nu-command::misc`, which can be changed :+1: # User-Facing Changes ``` $nothing ``` # Tests + Formatting - :green_circle: `toolkit fmt` - :green_circle: `toolkit clippy` - :black_circle: `toolkit test` - :black_circle: `toolkit test stdlib` # After Submitting ``` $nothing ``` --- crates/nu-command/src/default_context.rs | 2 +- crates/nu-command/src/deprecated/mod.rs | 2 -- crates/nu-command/src/misc/mod.rs | 2 ++ crates/nu-command/src/{deprecated => misc}/source.rs | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename crates/nu-command/src/{deprecated => misc}/source.rs (100%) diff --git a/crates/nu-command/src/default_context.rs b/crates/nu-command/src/default_context.rs index fb80c7989..4b17fa412 100644 --- a/crates/nu-command/src/default_context.rs +++ b/crates/nu-command/src/default_context.rs @@ -103,6 +103,7 @@ pub fn create_default_context() -> EngineState { // Misc bind_command! { + Source, Tutor, }; @@ -443,7 +444,6 @@ pub fn create_default_context() -> EngineState { MathEvalDeprecated, OldAlias, RPadDeprecated, - Source, StrCollectDeprecated, StrDatetimeDeprecated, StrDecimalDeprecated, diff --git a/crates/nu-command/src/deprecated/mod.rs b/crates/nu-command/src/deprecated/mod.rs index a63676303..241fa159a 100644 --- a/crates/nu-command/src/deprecated/mod.rs +++ b/crates/nu-command/src/deprecated/mod.rs @@ -6,7 +6,6 @@ mod lpad; mod math_eval; mod old_alias; mod rpad; -mod source; mod str_datetime; mod str_decimal; mod str_find_replace; @@ -20,7 +19,6 @@ pub use lpad::LPadDeprecated; pub use math_eval::SubCommand as MathEvalDeprecated; pub use old_alias::OldAlias; pub use rpad::RPadDeprecated; -pub use source::Source; pub use str_datetime::StrDatetimeDeprecated; pub use str_decimal::StrDecimalDeprecated; pub use str_find_replace::StrFindReplaceDeprecated; diff --git a/crates/nu-command/src/misc/mod.rs b/crates/nu-command/src/misc/mod.rs index 76df7f693..5c632e00e 100644 --- a/crates/nu-command/src/misc/mod.rs +++ b/crates/nu-command/src/misc/mod.rs @@ -1,3 +1,5 @@ +mod source; mod tutor; +pub use source::Source; pub use tutor::Tutor; diff --git a/crates/nu-command/src/deprecated/source.rs b/crates/nu-command/src/misc/source.rs similarity index 100% rename from crates/nu-command/src/deprecated/source.rs rename to crates/nu-command/src/misc/source.rs