1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use std::borrow::Borrow;
use ::api::method::BooleanCast;
use ::api::result::ObjectResult;
use ::api::RtObject as ObjectRef;
use ::modules::builtins::Type;
use ::runtime::Runtime;
use ::runtime::traits::BooleanProvider;
pub fn logical_and<'a>(rt: &Runtime, lhs: &ObjectRef, rhs: &ObjectRef) -> ObjectResult {
match lhs.op_bool(rt) {
Ok(object) => {
if object == rt.bool(false) {
return Ok(lhs.clone())
}
},
Err(err) => return Err(err)
};
Ok(rhs.clone())
}