@@ -1,5 +1,6 @@
1use std::borrow::Cow;
1use std::borrow::Cow;
2use std::fs;
2use std::fs;
4use clap::crate_version;
5use clap::crate_version;
@@ -52,6 +53,14 @@ pub fn assets_from_cache_or_binary(use_custom_assets: bool) -> Result<Highlighti
53fn clear_asset(filename: &str, description: &str) {
54fn clear_asset(filename: &str, description: &str) {
54 print!("Clearing {} ... ", description);
55 print!("Clearing {} ... ", description);
55− fs::remove_file(PROJECT_DIRS.cache_dir().join(filename)).ok();
56+ let path = PROJECT_DIRS.cache_dir().join(filename);
57+ match fs::remove_file(&path) {
58+ Err(err) if err.kind() == io::ErrorKind::NotFound => {
59+ println!("skipped (not present)");
62+ println!("could not remove the cache file {:?}: {}", &path, err);
56− println!("okay");
64+ Ok(_) => println!("okay"),