Skip to content

Conversation

@Skgland
Copy link
Contributor

@Skgland Skgland commented Sep 26, 2020

maps error for all remove_dir_all calls where the result is not ignored (all but one) to the added Custom error type to also display the directory path

EDIT: also do this for file removals

Copy link
Member

@pietroalbini pietroalbini left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! Left some feedback.

@shepmaster
Copy link
Member

This may be reimplementing https://crates.io/crates/fs-err

@Skgland
Copy link
Contributor Author

Skgland commented Sep 28, 2020

Did't know about fs-err until now. Though that wouldn't work for remove_dir_all as this project is not using std::fs::remove_dir_all, probably because of rust-lang/rust#29497.
So that wrapper of the two would still be necessary.

@Skgland
Copy link
Contributor Author

Skgland commented Sep 28, 2020

Though it might be reasonable to also get better errors for other Filesystem operations using fs-err only leaving remove_dir_all like this.

@Skgland
Copy link
Contributor Author

Skgland commented Sep 28, 2020

Opened PR #47 to expand on this using fs-err for all Filesystem operations where possible.

@pietroalbini
Copy link
Member

I feel like this approach is better than #47: bringing another dependency just for this is not really needed.

Thanks for working on the PRs! Merging.

@pietroalbini pietroalbini merged commit d2c0723 into rust-lang:master Oct 2, 2020
@Skgland Skgland deleted the fix-issue-43 branch October 2, 2020 10:51
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.

3 participants