fs_utils::remove

Function cleanup_folder

Source
pub fn cleanup_folder(folder_path: impl AsRef<Path>) -> Result<()>
Expand description

Cleans up the contents (files and folders) of the given folder while keeping the folder itself.

It is useful if you don’t want to loose the permissions set on the folder, or if you only have enough permissions to manipulate with the contents of the given folder, but not the folder itself.

It is a common pattern: