Method
contains
(&self, needle: Either<Self, PyIntRef>, vm: &VirtualMachine)
Source from the content-addressed store, hash-verified
| 317 | } |
| 318 | |
| 319 | pub fn contains(&self, needle: Either<Self, PyIntRef>, vm: &VirtualMachine) -> PyResult<bool> { |
| 320 | Ok(match needle { |
| 321 | Either::A(byte) => self.elements.contains_str(byte.elements.as_slice()), |
| 322 | Either::B(int) => self.elements.contains(&int.as_bigint().byte_or(vm)?), |
| 323 | }) |
| 324 | } |
| 325 | |
| 326 | pub fn isalnum(&self) -> bool { |
| 327 | !self.elements.is_empty() |
Tested by
no test coverage detected