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,
|
internal_span,
|
||||||
} = input
|
} = input
|
||||||
{
|
{
|
||||||
match timezone {
|
if let Some(tz) = timezone {
|
||||||
None => (),
|
|
||||||
Some(tz) => {
|
|
||||||
return Value::error(
|
return Value::error(
|
||||||
ShellError::IncompatibleParameters {
|
ShellError::IncompatibleParameters {
|
||||||
left_message: "got a record as input".into(),
|
left_message: "got a record as input".into(),
|
||||||
@ -296,11 +294,8 @@ fn action(input: &Value, args: &Arguments, head: Span) -> Value {
|
|||||||
head,
|
head,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
match dateformat {
|
if let Some(dt) = dateformat {
|
||||||
None => (),
|
|
||||||
Some(dt) => {
|
|
||||||
return Value::error(
|
return Value::error(
|
||||||
ShellError::IncompatibleParameters {
|
ShellError::IncompatibleParameters {
|
||||||
left_message: "got a record as input".into(),
|
left_message: "got a record as input".into(),
|
||||||
@ -311,7 +306,6 @@ fn action(input: &Value, args: &Arguments, head: Span) -> Value {
|
|||||||
head,
|
head,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return merge_record(record, head, *internal_span);
|
return merge_record(record, head, *internal_span);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user