Add more helper functions

This commit is contained in:
JT
2021-10-20 18:58:25 +13:00
parent 11070ffbbe
commit b322a12f58
12 changed files with 98 additions and 121 deletions

View File

@ -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(),
}),
},