Skip to content

Mark generated constructors as #[inline] - #258

Open
ChrisJr404 wants to merge 1 commit into
greyblake:masterfrom
ChrisJr404:inline-constructors
Open

Mark generated constructors as #[inline]#258
ChrisJr404 wants to merge 1 commit into
greyblake:masterfrom
ChrisJr404:inline-constructors

Conversation

@ChrisJr404

Copy link
Copy Markdown

Closes #237. into_inner already gets #[inline], but new, try_new and new_unchecked didn't, so they couldn't be inlined across crate boundaries (which is exactly the workspace case from that issue). This marks all three the same way.

I added a few unit tests that render the generated code and assert the attribute is present.

The into_inner method is already inlined, but new, try_new and
new_unchecked were not, so they could not be inlined across crate
boundaries. Mark them the same way. Closes greyblake#237.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is there a way to add #[inline] to the generated new and try_new methods?

1 participant