Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 444f5fe

Browse files
committed
Merge branch 'main' into feat/default-in-switch
2 parents d59a5d9 + d7f9595 commit 444f5fe

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

.taskcluster.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ tasks:
130130
cd rs/ &&
131131
cargo test
132132
- image: 'rust:latest'
133-
name: rust tests
133+
name: mdbook tests
134134
command:
135135
- /bin/bash
136136
- '-c'

rs/src/builtins.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,19 +175,10 @@ fn number_builtin(_context: &Context, args: &[Value]) -> Result<Value> {
175175
}
176176
let v = &args[0];
177177
let num: f64 = match v {
178-
Value::Null => 0.0,
179178
Value::String(s) => match s.parse() {
180179
Ok(num) => num,
181180
Err(_) => return Err(interpreter_error!("string can't be converted to number")),
182181
},
183-
Value::Number(num) => *num,
184-
Value::Bool(b) => {
185-
if *b {
186-
1.0
187-
} else {
188-
0.0
189-
}
190-
}
191182
_ => return Err(interpreter_error!("invalid arguments to builtin: number")),
192183
};
193184
Ok(Value::Number(num))

0 commit comments

Comments
 (0)