@@ -16,7 +16,7 @@ impl ToPyObject for bool {
1616
1717impl TryFromBorrowedObject for bool {
1818 fn try_from_borrowed_object ( vm : & VirtualMachine , obj : & PyObject ) -> PyResult < bool > {
19- if obj. fast_isinstance ( & vm. ctx . types . int_type ) {
19+ if obj. fast_isinstance ( vm. ctx . types . int_type ) {
2020 Ok ( get_value ( obj) )
2121 } else {
2222 Err ( vm. new_type_error ( format ! ( "Expected type bool, not {}" , obj. class( ) . name( ) ) ) )
@@ -38,7 +38,7 @@ impl PyObjectRef {
3838 // If descriptor returns Error, propagate it further
3939 let method = method_or_err?;
4040 let bool_obj = vm. invoke ( & method, ( ) ) ?;
41- if !bool_obj. fast_isinstance ( & vm. ctx . types . bool_type ) {
41+ if !bool_obj. fast_isinstance ( vm. ctx . types . bool_type ) {
4242 return Err ( vm. new_type_error ( format ! (
4343 "__bool__ should return bool, returned type {}" ,
4444 bool_obj. class( ) . name( )
@@ -81,7 +81,7 @@ pub struct PyBool;
8181
8282impl PyPayload for PyBool {
8383 fn class ( vm : & VirtualMachine ) -> & PyTypeRef {
84- & vm. ctx . types . bool_type
84+ vm. ctx . types . bool_type
8585 }
8686}
8787
@@ -95,7 +95,7 @@ impl Constructor for PyBool {
9595 type Args = OptionalArg < PyObjectRef > ;
9696
9797 fn py_new ( zelf : PyTypeRef , x : Self :: Args , vm : & VirtualMachine ) -> PyResult {
98- if !zelf. fast_isinstance ( & vm. ctx . types . type_type ) {
98+ if !zelf. fast_isinstance ( vm. ctx . types . type_type ) {
9999 let actual_class = zelf. class ( ) ;
100100 let actual_type = & actual_class. name ( ) ;
101101 return Err ( vm. new_type_error ( format ! (
@@ -132,8 +132,8 @@ impl PyBool {
132132 #[ pymethod( name = "__ror__" ) ]
133133 #[ pymethod( magic) ]
134134 fn or ( lhs : PyObjectRef , rhs : PyObjectRef , vm : & VirtualMachine ) -> PyObjectRef {
135- if lhs. fast_isinstance ( & vm. ctx . types . bool_type )
136- && rhs. fast_isinstance ( & vm. ctx . types . bool_type )
135+ if lhs. fast_isinstance ( vm. ctx . types . bool_type )
136+ && rhs. fast_isinstance ( vm. ctx . types . bool_type )
137137 {
138138 let lhs = get_value ( & lhs) ;
139139 let rhs = get_value ( & rhs) ;
@@ -146,8 +146,8 @@ impl PyBool {
146146 #[ pymethod( name = "__rand__" ) ]
147147 #[ pymethod( magic) ]
148148 fn and ( lhs : PyObjectRef , rhs : PyObjectRef , vm : & VirtualMachine ) -> PyObjectRef {
149- if lhs. fast_isinstance ( & vm. ctx . types . bool_type )
150- && rhs. fast_isinstance ( & vm. ctx . types . bool_type )
149+ if lhs. fast_isinstance ( vm. ctx . types . bool_type )
150+ && rhs. fast_isinstance ( vm. ctx . types . bool_type )
151151 {
152152 let lhs = get_value ( & lhs) ;
153153 let rhs = get_value ( & rhs) ;
@@ -160,8 +160,8 @@ impl PyBool {
160160 #[ pymethod( name = "__rxor__" ) ]
161161 #[ pymethod( magic) ]
162162 fn xor ( lhs : PyObjectRef , rhs : PyObjectRef , vm : & VirtualMachine ) -> PyObjectRef {
163- if lhs. fast_isinstance ( & vm. ctx . types . bool_type )
164- && rhs. fast_isinstance ( & vm. ctx . types . bool_type )
163+ if lhs. fast_isinstance ( vm. ctx . types . bool_type )
164+ && rhs. fast_isinstance ( vm. ctx . types . bool_type )
165165 {
166166 let lhs = get_value ( & lhs) ;
167167 let rhs = get_value ( & rhs) ;
@@ -173,11 +173,11 @@ impl PyBool {
173173}
174174
175175pub ( crate ) fn init ( context : & Context ) {
176- PyBool :: extend_class ( context, & context. types . bool_type ) ;
176+ PyBool :: extend_class ( context, context. types . bool_type ) ;
177177}
178178
179179// pub fn not(vm: &VirtualMachine, obj: &PyObject) -> PyResult<bool> {
180- // if obj.fast_isinstance(& vm.ctx.types.bool_type) {
180+ // if obj.fast_isinstance(vm.ctx.types.bool_type) {
181181// let value = get_value(obj);
182182// Ok(!value)
183183// } else {
0 commit comments