(&self, value: &BigInt)
| 117 | impl PyRange { |
| 118 | #[inline] |
| 119 | fn offset(&self, value: &BigInt) -> Option<BigInt> { |
| 120 | let start = self.start.as_bigint(); |
| 121 | let stop = self.stop.as_bigint(); |
| 122 | let step = self.step.as_bigint(); |
| 123 | match step.sign() { |
| 124 | Sign::Plus if value >= start && value < stop => Some(value - start), |
| 125 | Sign::Minus if value <= self.start.as_bigint() && value > stop => Some(start - value), |
| 126 | _ => None, |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | #[inline] |
| 131 | pub fn index_of(&self, value: &BigInt) -> Option<BigInt> { |
no test coverage detected