Closed dbsxdbsx closed 3 months ago
Yes that looks reasonable. IIRC, frb does not strictly follow the semantics of pub
of Rust, because the rules and all edge cases are somehow nontrivial. And fixing it will cause a breaking change (!), so we may consider this improvement in 3.0 version.
Ok, then just leave it as it is now. Feel free to close.
Ok, no problem
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.
Frb v2.2, win10.
Suppose the api module
rust\src\api\mod.rs
is this:and there is struct or fn with prefix
pub(crate)
inlog
, then everything is fine, thislog
module is transparent to dart and frb. But if the struct or fn is prefixed withpub
, then it is exposed to frb---But should it be visible or not?I realize this issue when I lint fix rust code with this cmd:
with removing
-A clippy::redundant_pub_crate
, after when rust automatically change mypub(crate) fn
intopub fn
in apub(crate)
module(log
in this case).So officially, Rust team thinks that anything inside a
pub(crate)
module would NOT surpass its visibility over its parent module---that is whypub
is already enough inside apub(crate)
module. I wonder if frb should make the logic consistent to rust, though I am ok with the current logic.