From 21ef3895b39f0452117255aeec6ed916ec5f900d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Sj=C3=B6=C3=B6h?= Date: Sat, 22 May 2021 07:09:50 +0200 Subject: [PATCH] delete crates/nu-command/src/commands/date/utc.rs (#3464) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `date utc` command was removed in this PR: https://github.com/nushell/nushell/pull/2780 The file was left but is no longer referenced from the parent module and was not used. Co-authored-by: Henrik Sjööh --- crates/nu-command/src/commands/date/utc.rs | 54 ---------------------- 1 file changed, 54 deletions(-) delete mode 100644 crates/nu-command/src/commands/date/utc.rs diff --git a/crates/nu-command/src/commands/date/utc.rs b/crates/nu-command/src/commands/date/utc.rs deleted file mode 100644 index af222f59b..000000000 --- a/crates/nu-command/src/commands/date/utc.rs +++ /dev/null @@ -1,54 +0,0 @@ -use crate::prelude::*; -use chrono::{DateTime, Utc}; -use nu_errors::ShellError; - -use crate::commands::date::utils::date_to_value; -use nu_engine::WholeStreamCommand; -use nu_protocol::Signature; - -pub struct Date; - -impl WholeStreamCommand for Date { - fn name(&self) -> &str { - "date utc" - } - - fn signature(&self) -> Signature { - Signature::build("date utc") - } - - fn usage(&self) -> &str { - "return the current date in utc." - } - - fn run(&self, args: CommandArgs) -> Result { - utc(args) - } -} - -pub fn utc(args: CommandArgs) -> Result { - let args = args.evaluate_once()?; - let tag = args.call_info.name_tag.clone(); - - let no_fmt = "".to_string(); - - let value = { - let local: DateTime = Utc::now(); - date_to_value(local, tag, no_fmt) - }; - - Ok(OutputStream::one(value)) -} - -#[cfg(test)] -mod tests { - use super::Date; - use super::ShellError; - - #[test] - fn examples_work_as_expected() -> Result<(), ShellError> { - use crate::examples::test as test_examples; - - test_examples(Date {}) - } -}