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

Remove path type generic for better ergonomic #496

Merged
merged 2 commits into from Jul 6, 2021
Merged

Remove path type generic for better ergonomic #496

merged 2 commits into from Jul 6, 2021

Conversation

aquarhead
Copy link
Contributor

@aquarhead aquarhead commented Jul 6, 2021

This could be especially useful when one parameter (e.g. protos) is dynamically collected while the other (includes) is statically defined. Splitting the type should make compile_protos easier to use, I also changed a few instances where type conversion was used to show the impact.

prost-build/src/lib.rs Outdated Show resolved Hide resolved
@aquarhead aquarhead changed the title Split the path type for better ergonomic Remove path type generic for better ergonomic Jul 6, 2021
Copy link
Member

@LucioFranco LucioFranco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@LucioFranco
Copy link
Member

@aquarhead looks like there is a test failure, could you fix that then we can merge this?

@aquarhead
Copy link
Contributor Author

I'll take a look

@aquarhead
Copy link
Contributor Author

So seems this will break if includes is empty, it previously works because it uses the type of protos to infer the type of &[]. I'm not sure there's a way to fix this (the type hint requirement)?

It seems this change would improve ergonomics when I have includes but would have the reverse effect when it's empty. Though using &[""] seems to be a workaround.

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.

None yet

2 participants