spotlit 0.1.4

A cross-platform desktop wallpaper companion for Windows Spotlight and Bing wallpapers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use std::{fs, path::Path};

use crate::core::{Result, SpotlitError};

pub(crate) fn remove_file_if_exists(path: &Path) -> Result<()> {
    match fs::remove_file(path) {
        Ok(()) => Ok(()),
        Err(source) if source.kind() == std::io::ErrorKind::NotFound => Ok(()),
        Err(source) => Err(SpotlitError::io(path, source)),
    }
}