Skip to content

Use io::Result in prototype documentation #62122

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

Closed
xavierd opened this issue Jun 25, 2019 · 1 comment
Closed

Use io::Result in prototype documentation #62122

xavierd opened this issue Jun 25, 2019 · 1 comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@xavierd
Copy link

xavierd commented Jun 25, 2019

For a newcomer, there is no reason to expect the return value of any I/O function (ie: std::io::Result) to be any different from std::result::Result as they are both shown to be Result in the documentation.

One easy way to disambiguate this would be to show the prototype to use io::Result instead of Result. For instance, the open function is shown as being:

pub fn open<P: AsRef<Path>>(path: P) -> Result<File>

It should be:

pub fn open<P: AsRef<Path>>(path: P) -> io::Result<File>

@xavierd xavierd changed the title Use io::Result in prototype documentation Use io::Result in prototype documentation Jun 25, 2019
@jonas-schievink jonas-schievink added C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 25, 2019
@jyn514
Copy link
Member

jyn514 commented Aug 27, 2020

Duplicate of #74924

@jyn514 jyn514 marked this as a duplicate of #74924 Aug 27, 2020
@jyn514 jyn514 closed this as completed Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: A feature request, i.e: not implemented / a PR. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants