Method
intersection
(&self, other: ArgIterable, vm: &VirtualMachine)
Source from the content-addressed store, hash-verified
| 253 | } |
| 254 | |
| 255 | pub(super) fn intersection(&self, other: ArgIterable, vm: &VirtualMachine) -> PyResult<Self> { |
| 256 | let set = Self::default(); |
| 257 | for item in other.iter(vm)? { |
| 258 | let obj = item?; |
| 259 | if self.contains(&obj, vm)? { |
| 260 | set.add(obj, vm)?; |
| 261 | } |
| 262 | } |
| 263 | Ok(set) |
| 264 | } |
| 265 | |
| 266 | pub(super) fn difference(&self, other: ArgIterable, vm: &VirtualMachine) -> PyResult<Self> { |
| 267 | let set = self.copy(); |
Tested by
no test coverage detected