Method
eq_only
(
self,
f: impl FnOnce() -> PyResult<PyComparisonValue>,
)
Source from the content-addressed store, hash-verified
| 1854 | |
| 1855 | impl PyComparisonOp { |
| 1856 | pub fn eq_only( |
| 1857 | self, |
| 1858 | f: impl FnOnce() -> PyResult<PyComparisonValue>, |
| 1859 | ) -> PyResult<PyComparisonValue> { |
| 1860 | match self { |
| 1861 | Self::Eq => f(), |
| 1862 | Self::Ne => f().map(|x| x.map(|eq| !eq)), |
| 1863 | _ => Ok(PyComparisonValue::NotImplemented), |
| 1864 | } |
| 1865 | } |
| 1866 | |
| 1867 | pub fn eval_ord(self, ord: Ordering) -> bool { |
| 1868 | match self { |
Tested by
no test coverage detected