rust-lang / rustwide

Execute your code on the Rust ecosystem.
Apache License 2.0
180 stars 44 forks source link

Attempt to fix issue 43 #46

Closed Skgland closed 3 years ago

Skgland commented 3 years ago

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

shepmaster commented 3 years ago

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

Skgland commented 3 years ago

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 https://github.com/rust-lang/rust/issues/29497. So that wrapper of the two would still be necessary.

Skgland commented 3 years ago

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 commented 3 years ago

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

pietroalbini commented 3 years ago

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.