Skip to content

Conversation

@ycscaly
Copy link
Contributor

@ycscaly ycscaly commented Oct 23, 2025

Addresses #991

@ycscaly ycscaly mentioned this pull request Oct 23, 2025
/// **Note:** if the second element is `None`, the first value may take any value.
#[inline]
pub(crate) const fn components_ref(&self) -> (&T, ConstChoice) {
pub const fn components_ref(&self) -> (&T, ConstChoice) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only one I'm a bit wary of exposing. Notably it exposes the inner T which may be in an invalid state.

Comment on lines +438 to +450
impl<const LIMBS: usize> ConstCtOption<(Uint<LIMBS>, ConstChoice)> {
/// Returns the contained value, consuming the `self` value.
///
/// # Panics
///
/// Panics if the value is none with a custom panic message provided by
/// `msg`.
#[inline]
pub const fn expect(self, msg: &str) -> (Uint<LIMBS>, ConstChoice) {
assert!(self.is_some.is_true_vartime(), "{}", msg);
self.value
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is related to components_ref somehow?

@tarcieri tarcieri requested a review from fjarri October 23, 2025 22:55
@tarcieri
Copy link
Member

Per the build failures, the functions that we do end up exposing will need documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants