-
Notifications
You must be signed in to change notification settings - Fork 19
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
refactor(pedm): cleanup and clippy #1288
Conversation
We control usage and there is more refractoring to come. `pub` is simpler. Modules are now `pub` to complete the change.
Let maintainers know that an action is required on their side
|
pub(crate) async fn post_elevate_session( | ||
pub async fn post_elevate_session( |
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.
question: Why did you make everything public? Is it API we actually intended to expose from this crate? I believe not, because, for instance, this function is an HTTP handler. I would rather not increase the API surface of any crate more than necessary.
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.
I figured it is simpler, because we control usage. There are no consumers of this crate at the moment. If you prefer, I can undo this commit to keep pub(crate)
.
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.
I understand where you come from, but the problem is that there is no dead_code lint across crate boundaries. We are much more likely to keep around dead code if it’s publicly exposed from the crate. I also tend to prefer clear pub(crate)
over pub
when the item is never used outside of the crate, just so I have a clear idea on what is an API boundary (even if we are the only ones to use it).
That being said, the workspace unused pub items problem could be addressed with a tool such as https://github.com/cpg314/cargo-workspace-unused-pub
If we integrate it in our CI, this may become mostly a non issue (besides my preference for clearly marking a pub(crate) item as pub(crate)).
This reverts commit 6bc3ea6.
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.
LGTM!
This resolves all clippy errors in the the devolutions-pedm crate.