-
Notifications
You must be signed in to change notification settings - Fork 409
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
Add archetype_native
attribute and make ContainerBlueprint
eager + partial
#8666
Conversation
Ha yeah I also ported |
Web viewer failed to build. | Result | Commit | Link | Manifest | Note: This comment is updated whenever you push a commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
}); | ||
let native_to_eager = quote! { | ||
impl From<&#native_name> for #name { | ||
#[rustfmt::skip] // so it doesn't take 1000 lines for no reason |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? Why would cargo fmt
produce 1000 lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rustfmt splits method chains no matter their length, so all the value.#field_name.clone().map(|batch| (batch.descriptor, batch.array))
emitted by this method turn into 4 lines each, which is really pushing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduces a new attribute that, when paired with an eager archetype, will also generate a native companion type with back-and-forth conversion methods.
This is especially useful for blueprint archetypes (although there are definitely non-blueprint examples too), which are heavily used all across the viewer, and would be very painful to use otherwise.
With this, we now should have all the tools required to port every remaining archetype (both blueprint and data).