From 7b2ebbf8ebe695fc9347a5288489052aa43f0224 Mon Sep 17 00:00:00 2001 From: Hendrik Sollich Date: Thu, 2 Nov 2023 23:09:11 +0100 Subject: [PATCH] refactor: clean up inline clippy config --- lang/default.pot | 2 +- src/lib.rs | 16 +--------------- src/storage/mod.rs | 2 +- src/util/mod.rs | 2 +- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/lang/default.pot b/lang/default.pot index 0a10e2720..1db3f0381 100644 --- a/lang/default.pot +++ b/lang/default.pot @@ -616,7 +616,7 @@ msgstr "" msgid "Project file is younger than pdf, continue anyway?" msgstr "" -#: /Users/hendrik/code/rust/asciii/src/lib.rs:82 +#: /Users/hendrik/code/rust/asciii/src/lib.rs:70 msgid "Documentation at: {}" msgstr "" diff --git a/src/lib.rs b/src/lib.rs index 3fe990403..3dee5ae25 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,21 +3,7 @@ //! #![cfg_attr(feature = "manual", doc = include_str!("../manual.md"))] #![allow(deprecated)] -#![allow(clippy::uninlined_format_args)] -#![warn(//missing_docs, - //missing_copy_implementations, - //missing_debug_implementations, - unstable_features, - unused_import_braces, - // clippy::pedantic - )] -// #![allow( -// clippy::if_not_else, -// clippy::must_use_candidate, -// clippy::missing_errors_doc, -// clippy::missing_panics_doc, -// clippy::wildcard_imports, -// )] +#![warn(clippy::if_not_else)] #![recursion_limit = "1024"] #![deny(trivial_casts, trivial_numeric_casts)] #![warn(unused_import_braces, unused_qualifications)] diff --git a/src/storage/mod.rs b/src/storage/mod.rs index 94d47ec2a..7f7a2270b 100644 --- a/src/storage/mod.rs +++ b/src/storage/mod.rs @@ -184,7 +184,7 @@ pub fn get_storage_path() -> PathBuf { // TODO: make replace tilde a Trait function let storage_path = replace_home_tilde(&storage_path); - if !storage_path.is_absolute() { + if storage_path.is_relative() { current_dir().unwrap().join(storage_path) } else { storage_path diff --git a/src/util/mod.rs b/src/util/mod.rs index 90616453e..3f5736504 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -145,7 +145,7 @@ where /// takes a path that could be relative or contains a `~` and turn it into a path that exists pub fn get_valid_path>(p: T) -> Option { let path = replace_home_tilde(Path::new(&p)); - let path = if !path.is_absolute() { + let path = if path.is_relative() { if cfg!(target_arch = "wasm32") { Ok(PathBuf::from(std::env::var("PWD").expect("can't access $PWD"))) } else {