Skip to content

refactor io dir to be same with std and export IntoInnerError #526

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

Merged
merged 2 commits into from
Nov 20, 2019

Conversation

yjhmelody
Copy link
Contributor

No description provided.

@yjhmelody yjhmelody changed the title refactor io dir to be same with std refactor io dir to be same with std and export IntoInnerError Nov 13, 2019
@yjhmelody
Copy link
Contributor Author

std export the IntoInnerError, so do we.
But I'm stranged that when I change to use std's IntoInnerError, the compiler reported errors. Though they are the same structure.

@@ -269,13 +269,15 @@
//! [`Result`]: https://doc.rust-lang.org/std/result/enum.Result.html
//! [`.unwrap()`]: https://doc.rust-lang.org/std/result/enum.Result.html#method.unwrap

const DEFAULT_BUF_SIZE: usize = 8 * 1024;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this const be marked pub(crate)? Is that even possible?

I guess I'm a bit confused how you're accessing this from other crates without it having a visibility specifier haha. Feel like I'm missing something about how consts work :P

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I think sub mod always can access father mod.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just like write tests in sub mod even for test some private functions.
I think pub(crate) is for being public to current crate and private to extern crate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See std::io, I just imitate its way of writing.
image

Copy link
Contributor

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Thanks heaps!

@yoshuawuyts yoshuawuyts added the enhancement New feature or request label Nov 20, 2019
@yoshuawuyts yoshuawuyts added this to the 1.1.0 milestone Nov 20, 2019
@yoshuawuyts yoshuawuyts merged commit 77800ab into async-rs:master Nov 20, 2019
@yjhmelody yjhmelody deleted the refactor-dir branch November 22, 2019 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants