Closed nathan-at-least closed 1 year ago
I find the generated API docs for use path::Foo as Bar to be confusing compared to type aliases.
use path::Foo as Bar
master
Currently in master, the identifier ipfs_api_backend_hyper::IpfsClient is defined as:
ipfs_api_backend_hyper::IpfsClient
pub use crate::{backend::HyperBackend as IpfsClient, error::Error};
The rendered API docs look like this:
What is the relationship of IpfsClient to HyperBackend?
IpfsClient
HyperBackend
I believe the root problem here is actually a rustdoc problem, but this PR uses type aliases to work around the ambiguity.
rustdoc
By introducing type aliases first of all the alias is documented explicitly:
-then when clicking through to the definition of HyperBackend the API is unambiguous:
ActixBackend
The equivalent for ActixBackend has this type alias:
-and this underlying backend API:
Thanks! This looks great!
@ferristseng did this change break the CI build?
I find the generated API docs for
use path::Foo as Bar
to be confusing compared to type aliases.Current docs from
master
branchCurrently in master, the identifier
ipfs_api_backend_hyper::IpfsClient
is defined as:The rendered API docs look like this:
What is the relationship of
IpfsClient
toHyperBackend
?I believe the root problem here is actually a
rustdoc
problem, but this PR uses type aliases to work around the ambiguity.With type aliases (this PR) in
HyperBackend
By introducing type aliases first of all the alias is documented explicitly:
-then when clicking through to the definition of
HyperBackend
the API is unambiguous:With type aliases (this PR) in
ActixBackend
The equivalent for
ActixBackend
has this type alias:-and this underlying backend API: