mirror of
https://github.com/nushell/nushell.git
synced 2025-06-20 01:48:09 +02:00
improve code
This commit is contained in:
parent
28ed857102
commit
b8ebb562ca
@ -283,9 +283,7 @@ fn action(input: &Value, args: &Arguments, head: Span) -> Value {
|
||||
internal_span,
|
||||
} = input
|
||||
{
|
||||
match timezone {
|
||||
None => (),
|
||||
Some(tz) => {
|
||||
if let Some(tz) = timezone {
|
||||
return Value::error(
|
||||
ShellError::IncompatibleParameters {
|
||||
left_message: "got a record as input".into(),
|
||||
@ -296,11 +294,8 @@ fn action(input: &Value, args: &Arguments, head: Span) -> Value {
|
||||
head,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
match dateformat {
|
||||
None => (),
|
||||
Some(dt) => {
|
||||
if let Some(dt) = dateformat {
|
||||
return Value::error(
|
||||
ShellError::IncompatibleParameters {
|
||||
left_message: "got a record as input".into(),
|
||||
@ -311,7 +306,6 @@ fn action(input: &Value, args: &Arguments, head: Span) -> Value {
|
||||
head,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return merge_record(record, head, *internal_span);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user