forked from extern/nushell
Make arg eval lazy, remove old arg evaluation code (#3603)
* Remove old argument eval * Merge main * fmt * clippy * clippy * clippy
This commit is contained in:
@ -44,7 +44,6 @@ impl WholeStreamCommand for Date {
|
||||
|
||||
pub fn format(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
let tag = args.call_info.name_tag.clone();
|
||||
let args = args.evaluate_once()?;
|
||||
|
||||
let format: Tagged<String> = args.req(0)?;
|
||||
let table: Option<bool> = args.get_flag("table")?;
|
||||
|
@ -41,8 +41,7 @@ impl WholeStreamCommand for Date {
|
||||
}
|
||||
|
||||
fn list_timezone(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
let args = args.evaluate_once()?;
|
||||
let tag = args.call_info.name_tag.clone();
|
||||
let tag = args.call_info.name_tag;
|
||||
|
||||
let list = TZ_VARIANTS.iter().map(move |tz| {
|
||||
let mut entries = IndexMap::new();
|
||||
|
@ -31,8 +31,6 @@ pub fn date_now(tag: &Tag) -> Value {
|
||||
}
|
||||
|
||||
pub fn now(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
let args = args.evaluate_once()?;
|
||||
|
||||
let value = date_now(&args.call_info.name_tag);
|
||||
|
||||
Ok(OutputStream::one(value))
|
||||
|
@ -34,7 +34,6 @@ impl WholeStreamCommand for Date {
|
||||
}
|
||||
|
||||
fn to_table(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
let args = args.evaluate_once()?;
|
||||
let tag = args.call_info.name_tag.clone();
|
||||
let input = if args.input.is_empty() {
|
||||
InputStream::one(crate::commands::date::now::date_now(&tag))
|
||||
|
@ -55,7 +55,6 @@ impl WholeStreamCommand for Date {
|
||||
|
||||
fn to_timezone(args: CommandArgs) -> Result<OutputStream, ShellError> {
|
||||
let tag = args.call_info.name_tag.clone();
|
||||
let args = args.evaluate_once()?;
|
||||
|
||||
let timezone: Tagged<String> = args.req(0)?;
|
||||
|
||||
|
Reference in New Issue
Block a user