Simplify implementation of Value::to_boolean.

This commit is contained in:
Bruce Mitchener
2018-03-25 19:43:23 +07:00
parent 684bbe33ab
commit e6077dce24

View File

@@ -62,8 +62,7 @@ impl Value {
}
pub fn to_boolean(&self, context: &GlobalContext) -> bool {
let value = unsafe { JSValueToBoolean(context.raw, self.raw) };
value != 0
unsafe { JSValueToBoolean(context.raw, self.raw) != 0}
}
pub fn to_string(&self, context: &GlobalContext) -> Option<String> {