pub fn safer_remove_dir<'a>(
dir_path: &SPath,
options: impl Into<SaferRemoveOptions<'a>>,
) -> Result<bool>Expand description
Safely deletes a directory if it passes safety checks.
Safety checks (based on options):
- If
restrict_to_current_diris true, the directory path must be below the current directory - If
must_contain_anyis set, the path must contain at least one of the specified patterns - If
must_contain_allis set, the path must contain all of the specified patterns
Returns Ok(true) if the directory was deleted, Ok(false) if it didn’t exist. Returns an error if safety checks fail or deletion fails.