-
-
Notifications
You must be signed in to change notification settings - Fork 184
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
book: Move from pub
to pub(crate)
#1484
Conversation
It is arguably the correct way for this
Using pub(crate) for a binary doesn't really make sense. |
@@ -5,9 +5,9 @@ use gtk::{glib, CompositeTemplate, Label}; | |||
// Object holding the state | |||
#[derive(CompositeTemplate, Default)] | |||
#[template(resource = "/org/gtk_rs/example/window.ui")] | |||
pub struct Window { |
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.
the imp struct could be pub(super) though
#[template_child] | ||
pub label: TemplateChild<Label>, | ||
pub(crate) label: TemplateChild<Label>, |
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.
same, it should be pub(super)
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 assume you mean pub(super)
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.
yes, edited
I thought so, too. |
you can't really detect dead code for gtk apps, especially if you use composite template callbacks |
Yeah, just noticed that too. Not sure if it's a macro thing, but static analysis totally fails there. |
The macro actually uses the functions to create closures from them, but they can only be used at runtime. so nothing can be done at build time... |
It is arguably the correct way for this