fs_extra icon indicating copy to clipboard operation
fs_extra copied to clipboard

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

Open KSXGitHub opened this issue 4 years ago • 2 comments

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

KSXGitHub avatar Apr 29 '20 15:04 KSXGitHub

@KSXGitHub total number of bytes copied

webdesus avatar May 04 '20 10:05 webdesus

@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,
}

KSXGitHub avatar May 04 '20 10:05 KSXGitHub