-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow both Option=!
and Option=WrappedType
for optional fields
#34
Labels
enhancement
New feature or request
Comments
Sounds good. I may also add a setting (to be defined) when set makes available following functions: // Named
fn field<T: Into<X>>(value: Option<T>) {}
fn field_some<T: Into<X>>(value: T) {}
fn field_none() {}
// Tuple - Unordered
fn set0<T: Into<X>>(value: Option<T>) {}
fn set0_some<T: Into<X>>(value: T) {}
fn set0_none() {}
// Tuple - Ordered
fn set<T: Into<X>>(value: Option<T>) {}
fn some<T: Into<X>>(value: T) {}
fn none() {} As I'm giving a talk (about Rust btw :) ) next week, I won't have time to take a look until next week-end. |
loganmzz
added a commit
that referenced
this issue
Nov 14, 2024
loganmzz
added a commit
that referenced
this issue
Nov 21, 2024
loganmzz
added a commit
that referenced
this issue
Nov 26, 2024
loganmzz
added a commit
that referenced
this issue
Nov 26, 2024
loganmzz
added a commit
that referenced
this issue
Dec 3, 2024
loganmzz
added a commit
that referenced
this issue
Dec 5, 2024
loganmzz
added a commit
that referenced
this issue
Dec 5, 2024
loganmzz
added a commit
that referenced
this issue
Dec 5, 2024
loganmzz
added a commit
that referenced
this issue
Dec 17, 2024
@RustyNova016 Sorry for the delay, I have released 1.3.0, but without setting to reverse optional setters (Option by default and |
Neat! Thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, you need to choose between whether giving an Option or a value for optional fields. But sometimes, it's easier to give an option to a builder, and others a value.
It would be great to have a
Builder::field_optional()
function when usingOption=WrappedType
that takes in a Option, allowing for both styles depending on the use of the builderThe text was updated successfully, but these errors were encountered: