You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey all!
Following this conversation on Kakarot, kkrt-labs/kakarot-ssj#322 (comment)
We wanted to see if it's possible to incorporate a unwrap_or method in the OptionTrait.
Describe Preferred Solution
Add one function in the OptionTrait: unwrap_or
pseudo code:
fn unwrap_or(self: Option<T>, default: T) -> T {
match self {
Option::Some(x) => x,
Option::None => default,
}
}
Additionally, I can implement unwrap_or_default
fn unwrap_or_default<+Default<T>>(self: Option<T>) -> T {
match self {
Option::Some(x) => x,
Option::None => Default::default(),
}
}
Additional Context
If the feature request is approved, would you be willing to submit a PR? (Help can be provided if you need assistance submitting a PR)
Yes
No
The text was updated successfully, but these errors were encountered:
Feature Request
Describe the Feature Request
Hey all!
Following this conversation on Kakarot, kkrt-labs/kakarot-ssj#322 (comment)
We wanted to see if it's possible to incorporate a
unwrap_or
method in the OptionTrait.Describe Preferred Solution
Add one function in the OptionTrait:
unwrap_or
pseudo code:
Additionally, I can implement
unwrap_or_default
Additional Context
If the feature request is approved, would you be willing to submit a PR?
(Help can be provided if you need assistance submitting a PR)
The text was updated successfully, but these errors were encountered: