diff --git a/Cargo.lock b/Cargo.lock index d49732c757..46ac2a263e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "rust-python-linter" -version = "0.0.6" +version = "0.0.7" dependencies = [ "anyhow", "bincode", diff --git a/Cargo.toml b/Cargo.toml index 98ebe5fbe5..83a9eab2d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rust-python-linter" -version = "0.0.6" +version = "0.0.7" edition = "2021" [lib] @@ -13,7 +13,7 @@ bincode = { version = "1.3.3" } cacache = { version = "10.0.1" } chrono = { version = "0.4.21" } clap = { version = "3.2.16", features = ["derive"] } -clearscreen = "1.0.10" +clearscreen = { version = "1.0.10" } colored = { version = "2.0.0" } fern = { version = "0.6.1" } log = { version = "0.4.17" } diff --git a/src/cache.rs b/src/cache.rs index 96b3527724..661b5b5530 100644 --- a/src/cache.rs +++ b/src/cache.rs @@ -1,4 +1,3 @@ -use std::borrow::Cow; use std::os::unix::fs::MetadataExt; use std::path::Path; @@ -8,6 +7,8 @@ use serde::{Deserialize, Serialize}; use crate::message::Message; +const VERSION: &str = env!("CARGO_PKG_VERSION"); + #[derive(Serialize, Deserialize)] struct CacheMetadata { size: u64, @@ -66,8 +67,8 @@ fn cache_dir() -> &'static str { "./.cache" } -fn cache_key(path: &Path) -> Cow { - path.to_string_lossy() +fn cache_key(path: &Path) -> String { + format!("{}@{}", path.to_string_lossy(), VERSION) } pub fn get(path: &Path, mode: &Mode) -> Option> {