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