-
Notifications
You must be signed in to change notification settings - Fork 90
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
Implement TryFrom<Builder> for Target for all builders exposing a public build method #76
Comments
Makes sense 👍 I generally agree that we should always emit that implementation. There is only one reason to make it opt-into and that is backwards compatibility with Rust 1.15-x. I don't want to drop backwards compatibility on every new cool feature. For some intermediate time I would like to make it opt-in (either feature flag or attribute). And after some time we can raise the minimum Rust version and get rid of opting-in. I guess a feature flag would be a little easier to implement? With this we can already implement it for nightly. :-) Minor corrections in your code example
|
I went with feature flag. |
Ah .. I see .. I thought the outer Ok, that was fast. I'll review later. Have to got now. :-) |
|
Is this still being looked at? Would love if the From and TryFrom traits were implemented. |
It is not actively being looked at.
|
The lack of interest in this over the years makes me think it's not worth the complexity of implementation. |
With #72 (fallible setters) merged and rust-lang/rust#33417 (
TryFrom
) approaching stabilization, having aTryFrom<Builder> for Target
implementation for all builders with a generatedbuild
method will enable the following code:Once
TryFrom
is stabilized I'm not planning to expose a struct-level attribute to control this. This seems too standard for a crate user not to want. #70 gives authors control over exposing thebuild
method; this would look to that attribute and skip implementation if thebuild
method was skipped.I'm planning to take a stab at a PR for this.
The text was updated successfully, but these errors were encountered: