Repository navigation
refactor: Add FileIO::remove_dir_all to deprecate remove_dir - #1275
Conversation
Signed-off-by: Xuanwo <[email protected]>
liurenjie1024
left a comment
There was a problem hiding this comment.
Thanks @Xuanwo for this pr, just a nit!
| /// | ||
| /// * path: It should be *absolute* path starting with scheme string used to construct [`FileIO`]. | ||
| pub async fn remove_all(&self, path: impl AsRef<str>) -> Result<()> { | ||
| pub async fn remove_dir_all(&self, path: impl AsRef<str>) -> Result<()> { |
There was a problem hiding this comment.
- It would be better to add doc to explain the behavior, e.g. what if the dir doesn't exist, what if the dir is empty.
- Add test case for path not ending with "/"
There was a problem hiding this comment.
maybe also add a test for if the path (without ending in /) refers to a file instead of dir. should be no-op
| /// | ||
| /// * path: It should be *absolute* path starting with scheme string used to construct [`FileIO`]. | ||
| pub async fn remove_all(&self, path: impl AsRef<str>) -> Result<()> { | ||
| pub async fn remove_dir_all(&self, path: impl AsRef<str>) -> Result<()> { |
There was a problem hiding this comment.
is this a breaking change? i.e. something we should warn users about on the next release
There was a problem hiding this comment.
+1, we could deprecate the old one, and recommend the new api.
| /// | ||
| /// * path: It should be *absolute* path starting with scheme string used to construct [`FileIO`]. | ||
| pub async fn remove_all(&self, path: impl AsRef<str>) -> Result<()> { | ||
| pub async fn remove_dir_all(&self, path: impl AsRef<str>) -> Result<()> { |
There was a problem hiding this comment.
maybe also add a test for if the path (without ending in /) refers to a file instead of dir. should be no-op
|
Thank you all for the review, I will start addressing them today. |
Signed-off-by: Xuanwo <[email protected]>
kevinjqliu
left a comment
There was a problem hiding this comment.
LGTM!
cc @liurenjie1024 to take a final look.
cc @c-thiel as well since he opened the original issue
liurenjie1024
left a comment
There was a problem hiding this comment.
Thanks @Xuanwo for this pr!
Which issue does this PR close?
remove_allbehavior for S3 #1118What changes are included in this PR?
Change FileIO::remove_all to remove_dir_all to make it's behavior more clear.
Are these changes tested?