Skip to content
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

What is the return type of fs_extra::dir::copy? #28

Open
KSXGitHub opened this issue Apr 29, 2020 · 2 comments
Open

What is the return type of fs_extra::dir::copy? #28

KSXGitHub opened this issue Apr 29, 2020 · 2 comments

Comments

@KSXGitHub
Copy link
Contributor

It is Result<u32>, not Result<()>, but the documentation does not tell what that number (u32) means.

@webdesus
Copy link
Owner

webdesus commented May 4, 2020

@KSXGitHub total number of bytes copied

@KSXGitHub
Copy link
Contributor Author

@webdesus I guessed so from reading the source code.

I do think that in addition to adding a documentation, you should change return type of this function to a named struct with descriptive fields, so that IDE user may not need to actually open documentation to understand what it means, for example:

pub struct CopyReturn {
  pub bytes_copied: usize,
  pub files_copied: usize,
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants