Modified Str -> Int coercion
parent
4b7aa07d06
commit
b6f37b6ced
|
@ -213,7 +213,9 @@ impl Value {
|
|||
},
|
||||
Value::Int(i) => i,
|
||||
Value::Nul => consts::ANSWER,
|
||||
Value::Str(text) => text.parse().unwrap_or(consts::ANSWER),
|
||||
Value::Str(text) => text
|
||||
.parse()
|
||||
.unwrap_or_else(|_| text.chars().map(|cr| cr as isize).sum()),
|
||||
Value::Cart(c) => c
|
||||
.into_iter()
|
||||
.map(|(i, v)| i.into_isize() * v.borrow().clone().into_isize())
|
||||
|
|
Loading…
Reference in New Issue