Conditionally inserts `value` into the [`CtOption`] if the given condition holds.
(&mut self, value: &T, condition: Choice)
| 173 | |
| 174 | /// Conditionally inserts `value` into the [`CtOption`] if the given condition holds. |
| 175 | pub fn insert_if(&mut self, value: &T, condition: Choice) |
| 176 | where |
| 177 | T: CtAssign, |
| 178 | { |
| 179 | self.value.ct_assign(value, condition); |
| 180 | self.is_some.ct_assign(&Choice::TRUE, condition); |
| 181 | } |
| 182 | |
| 183 | /// Convert the [`CtOption`] wrapper into an [`Option`], depending on whether |
| 184 | /// [`CtOption::is_some`] is a truthy or falsy [`Choice`]. |