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

Update append_dir_all doc test #364

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

schneems
Copy link
Contributor

@schneems schneems commented Jun 6, 2024

Call finish

The text of append_dir_all suggests that finish must always be called. This commit updates the example to call finish.

Link to into_inner

Further, the docs for finish suggest that into_inner is an alternate (and possibly preferred), so I added a link to that function.

/// In most situations the into_inner method should be preferred.
pub fn finish(&mut self) -> io::Result<()> {

Label which directory is which in the comment

Lastly, I needed clarification about which directory was renamed in the example. Without prior knowledge, it could be that a directory named "bardir" is being renamed to the current dir or that the current dir is being inserted as a "bardir." The input args are path and src_path, which provides a little clue.

To make the example more explicit, I added that information to the comment.

## Call `finish`

The text of `append_dir_all` suggests that `finish` must always be called. This commit updates the example to call `finish`.

## Link to `into_inner`

Further, the docs for `finish` suggest that `into_inner` is an alternate (and possibly preferred), so I added a link to that function.

> /// In most situations the `into_inner` method should be preferred.
>     pub fn finish(&mut self) -> io::Result<()> {

## Label which directory is which in the comment

Lastly, I needed clarification about which directory was renamed in the example. Without prior knowledge, it could be that a directory named "bardir" is being renamed to the current dir or that the current dir is being inserted as a "bardir." The input args are `path` and `src_path`, which provides a little clue. 

To make the example more explicit, I added that information to the comment.
@schneems schneems marked this pull request as ready for review June 6, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant