Skip to content

Avoid generating needless lifetimes#635

Open
jayvdb wants to merge 7 commits into
oxidecomputer:mainfrom
jayvdb:avoid_needless_lifetimes
Open

Avoid generating needless lifetimes#635
jayvdb wants to merge 7 commits into
oxidecomputer:mainfrom
jayvdb:avoid_needless_lifetimes

Conversation

@jayvdb

@jayvdb jayvdb commented Nov 26, 2023

Copy link
Copy Markdown
Contributor

No description provided.

@ahl

ahl commented Nov 30, 2023

Copy link
Copy Markdown
Collaborator

I think there are still cases where we generate lifetimes where we don't need it. My preference would be to either avoid them entirely or just generate them all the time. The benefit of avoiding needless lifetimes is that people wouldn't need to ignore the lint; the benefit of generating them all the time is simplicity of codegen. I think that not generating them sometimes means that people (may) still need to ignore the lint and the code is more complex.

@jayvdb

jayvdb commented Dec 3, 2023

Copy link
Copy Markdown
Contributor Author

This avoids all of the needless lifetimes in my generated clients, covering 51 endpoints.

I'll dig into how to prove there are no other needless lifetimes. :/

@jayvdb

jayvdb commented Dec 13, 2023

Copy link
Copy Markdown
Contributor Author

fyi, you were right. #638 allowed me to see some other cases. I'll see if they can be removed without adding too much complexity.

@ahl

ahl commented Dec 13, 2023

Copy link
Copy Markdown
Collaborator

Sounds good. I think it may be that the complexity of avoiding needless lifetimes may outweigh the benefit... but I'd love to be proved wrong!

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.

2 participants