From 64aed34eff90d436523f3661ff1ded01d72aa1c7 Mon Sep 17 00:00:00 2001 From: Jonas Kruckenberg Date: Wed, 14 Dec 2022 20:46:23 +0100 Subject: [PATCH] clippy --- Cargo.lock | 1 + plugins/log/src/lib.rs | 4 ++-- plugins/persisted-scope/src/lib.rs | 2 +- plugins/positioner/Cargo.toml | 1 + plugins/store/src/store.rs | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b2f9f25..1002e9b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4200,6 +4200,7 @@ dependencies = [ "log 0.4.17", "serde", "serde_json", + "serde_repr", "tauri", "thiserror", ] diff --git a/plugins/log/src/lib.rs b/plugins/log/src/lib.rs index 89ee1ff4..9288fe01 100644 --- a/plugins/log/src/lib.rs +++ b/plugins/log/src/lib.rs @@ -252,7 +252,7 @@ impl LoggerBuilder { LogTarget::Stderr => fern::Output::from(std::io::stderr()), LogTarget::Folder(path) => { if !path.exists() { - fs::create_dir_all(&path).unwrap(); + fs::create_dir_all(path).unwrap(); } fern::log_file(get_log_file_path( @@ -264,7 +264,7 @@ impl LoggerBuilder { .into() } LogTarget::LogDir => { - let path = app_handle.path_resolver().log_dir().unwrap(); + let path = app_handle.path_resolver().app_log_dir().unwrap(); if !path.exists() { fs::create_dir_all(&path).unwrap(); } diff --git a/plugins/persisted-scope/src/lib.rs b/plugins/persisted-scope/src/lib.rs index f86a1407..6827e4cd 100644 --- a/plugins/persisted-scope/src/lib.rs +++ b/plugins/persisted-scope/src/lib.rs @@ -40,7 +40,7 @@ pub fn init() -> TauriPlugin { #[cfg(feature = "protocol-asset")] let asset_protocol_scope = app.asset_protocol_scope(); let app = app.clone(); - let app_dir = app.path_resolver().app_dir(); + let app_dir = app.path_resolver().app_data_dir(); if let Some(app_dir) = app_dir { let scope_state_path = app_dir.join(SCOPE_STATE_FILENAME); diff --git a/plugins/positioner/Cargo.toml b/plugins/positioner/Cargo.toml index 593c106e..59a9cfef 100644 --- a/plugins/positioner/Cargo.toml +++ b/plugins/positioner/Cargo.toml @@ -13,6 +13,7 @@ serde_json.workspace = true tauri.workspace = true log.workspace = true thiserror.workspace = true +serde_repr = "0.1" [features] system-tray = [ "tauri/system-tray" ] \ No newline at end of file diff --git a/plugins/store/src/store.rs b/plugins/store/src/store.rs index 9f29250f..867bb0cd 100644 --- a/plugins/store/src/store.rs +++ b/plugins/store/src/store.rs @@ -172,7 +172,7 @@ impl Store { pub fn load(&mut self, app: &AppHandle) -> Result<(), Error> { let app_dir = app .path_resolver() - .app_dir() + .app_data_dir() .expect("failed to resolve app dir"); let store_path = app_dir.join(&self.path); @@ -187,7 +187,7 @@ impl Store { pub fn save(&self, app: &AppHandle) -> Result<(), Error> { let app_dir = app .path_resolver() - .app_dir() + .app_data_dir() .expect("failed to resolve app dir"); let store_path = app_dir.join(&self.path);