mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 03:38:07 +02:00
Add more helper functions
This commit is contained in:
@ -55,26 +55,17 @@ impl Command for SubCommand {
|
||||
Example {
|
||||
description: "Convert string to integer",
|
||||
example: "'2' | into int",
|
||||
result: Some(Value::Int {
|
||||
val: 2,
|
||||
span: Span::unknown(),
|
||||
}),
|
||||
result: Some(Value::test_int(2)),
|
||||
},
|
||||
Example {
|
||||
description: "Convert decimal to integer",
|
||||
example: "5.9 | into int",
|
||||
result: Some(Value::Int {
|
||||
val: 5,
|
||||
span: Span::unknown(),
|
||||
}),
|
||||
result: Some(Value::test_int(5)),
|
||||
},
|
||||
Example {
|
||||
description: "Convert decimal string to integer",
|
||||
example: "'5.9' | into int",
|
||||
result: Some(Value::Int {
|
||||
val: 5,
|
||||
span: Span::unknown(),
|
||||
}),
|
||||
result: Some(Value::test_int(5)),
|
||||
},
|
||||
Example {
|
||||
description: "Convert file size to integer",
|
||||
@ -88,18 +79,9 @@ impl Command for SubCommand {
|
||||
description: "Convert bool to integer",
|
||||
example: "[$false, $true] | into int",
|
||||
result: Some(Value::Stream {
|
||||
stream: vec![
|
||||
Value::Int {
|
||||
val: 0,
|
||||
span: Span::unknown(),
|
||||
},
|
||||
Value::Int {
|
||||
val: 1,
|
||||
span: Span::unknown(),
|
||||
},
|
||||
]
|
||||
.into_iter()
|
||||
.into_value_stream(),
|
||||
stream: vec![Value::test_int(0), Value::test_int(1)]
|
||||
.into_iter()
|
||||
.into_value_stream(),
|
||||
span: Span::unknown(),
|
||||
}),
|
||||
},
|
||||
|
Reference in New Issue
Block a user