Skip to content
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

Avoid generating needless lifetimes #635

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jayvdb
Copy link
Contributor

@jayvdb jayvdb commented Nov 26, 2023

No description provided.

@ahl
Copy link
Collaborator

ahl commented Nov 30, 2023

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
Copy link
Contributor Author

jayvdb commented Dec 3, 2023

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
Copy link
Contributor Author

jayvdb commented Dec 13, 2023

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
Copy link
Collaborator

ahl commented Dec 13, 2023

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