ksud: minor tweaks

This commit is contained in:
weishu
2024-01-04 16:12:15 +08:00
parent 153ce9a39a
commit 01711b4114
2 changed files with 20 additions and 22 deletions

View File

@@ -45,7 +45,11 @@ pub fn ensure_dir_exists<T: AsRef<Path>>(dir: T) -> Result<()> {
}
}
pub fn ensure_binary<T: AsRef<Path>>(path: T, contents: &[u8], ignore_if_exist: bool) -> Result<()> {
pub fn ensure_binary<T: AsRef<Path>>(
path: T,
contents: &[u8],
ignore_if_exist: bool,
) -> Result<()> {
if ignore_if_exist && path.as_ref().exists() {
return Ok(());
}