Closed sdedovic closed 2 years ago
For now, this is simply a stylistic choice. I would accept a PR if you would be able to provide a link to some official Rust guidelines explaining how this particular case should be handled.
There have been some discussions about this in the past, but nothing concrete was decided. There is also Effective Rust guide which recommends re-exporting dependencies, although it is not official. (And I would also prefer re-exported dependencies for the same reasons as above.)
Is there a reason why types used in the public API from external crates are not re-exported?
For example, the render function:
has Types from
usvg
andtiny_skia
. In order to use this API, I need to add these two libraries to myCargo.toml
. Presumably I also need to keep version in sync in case of incompatible changes.I think it would make a log more sense to re-export these types under
resvg::usvg::*
andresvg::tiny_skia::*
. That way I only theresvg
library and I get the transitive dependencies for free.I am happy to put out a PR with this change. Just didn't see any discussion about it and I don't want to put the work in if it's unwanted.