Closed evshary closed 3 months ago
I'm not sure about this change... @milyin ?
@Mallets you should have tagged me also 🙂
@evshary Reexporting in root is a common practice across Rust ecosystem; you never use serde::ser::Serialize
but serde::Serialize
. Having root reexport of Result
overload (and custom Error
) is also quite a convention, see serde_json::Result
/serde_json::Error
.
You may be interested in #1007 where the discussion about root reexporting took place.
@wyfo You convince me now why putting these under the root. Then, the question might be why we choose these to re-export. Is there any rule for this?
There is no "rule" as far as I know. Some crates like rand
choose to not reexport, others like serde_json
do it. So you can find both in fundamental crates of the ecosystem.
IMO, it is a matter of taste. When I wrote the reexports, I had serde_json
way of doing in mind. This is obviously a debatable decision, and we solve and close that debate quickly before 1.0.
That's also something we could ask on Reddit like folks of ratatui
did. Thanks to those Reddit/Rust forum discussion, we already closed the prelude discussion by keeping only traits in it.
I think I will open a Reddit discussion on Monday.
Superseded by https://github.com/eclipse-zenoh/zenoh/pull/1193
Now there are some duplicate imports in
lib.rs
For session one, it's used commonly and perhaps it makes sense to have a shorter path. However, I would suggest not to have duplicate paths for others.