-
Notifications
You must be signed in to change notification settings - Fork 58
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
Could Default be implemented for Field? #234
Comments
I'm not sure I understand how this could be implemented in a way that could be useful in the LabelledGeneric context. Can you please either elaborate or send a PR with a test showing your proposal in action? |
I had in mind something like reverse #[derive(LabelledGeneric, Default, Debug)]
struct A {d: i8, b: String, c: f32, a: i32}
#[derive(LabelledGeneric, Default, Debug)]
struct B {a: i32, b: String}
let (_, remainder): (<B as LabelledGeneric>::Repr, _) = into_labelled_generic(A::default()).sculpt();
let a: A = from_labelled_generic(into_labelled_generic(B {a: 1, b: "2".into()}).extend(remainder).sculpt().0); Maybe Also maybe if the associated type for |
So it would be possible to use
lift_from
andlift_into
also with labelled generic.The text was updated successfully, but these errors were encountered: