From cff933b0bf7d1e0b72228320dd9660b62b629359 Mon Sep 17 00:00:00 2001 From: Joscha Date: Wed, 4 Dec 2024 20:12:44 +0100 Subject: [PATCH] Add and fix more lints --- Cargo.lock | 11 +---------- Cargo.toml | 16 +++++++++++++++- cove-input/src/lib.rs | 2 +- cove-macro/Cargo.toml | 1 - cove-macro/src/key_group.rs | 4 ++-- cove/Cargo.toml | 5 ----- 6 files changed, 19 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da7fbb2..e31a89c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -158,12 +158,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" -[[package]] -name = "case" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6c0e7b807d60291f42f33f58480c0bfafe28ed08286446f45e463728cf9c1c" - [[package]] name = "caseless" version = "0.2.1" @@ -287,10 +281,8 @@ dependencies = [ "thiserror", "time", "tokio", - "tokio-tungstenite", "toss", "tz-rs", - "unicode-segmentation", "unicode-width", "vault", ] @@ -324,7 +316,6 @@ dependencies = [ name = "cove-macro" version = "0.8.3" dependencies = [ - "case", "proc-macro2", "quote", "syn", diff --git a/Cargo.toml b/Cargo.toml index 7438604..bda342f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,12 +19,26 @@ tag = "v0.2.3" [workspace.lints] rust.unsafe_code = { level = "forbid", priority = 1 } +# Lint groups +rust.deprecated_safe = "warn" rust.future_incompatible = "warn" +rust.keyword_idents = "warn" rust.rust_2018_idioms = "warn" rust.unused = "warn" -rust.noop_method_call = "warn" +# Individual lints +rust.non_local_definitions = "warn" +rust.redundant_imports = "warn" +rust.redundant_lifetimes = "warn" rust.single_use_lifetimes = "warn" +rust.unit_bindings = "warn" +rust.unnameable_types = "warn" +rust.unused_crate_dependencies = "warn" +rust.unused_import_braces = "warn" +rust.unused_lifetimes = "warn" +rust.unused_qualifications = "warn" +# Clippy clippy.use_self = "warn" + [profile.dev.package."*"] opt-level = 3 diff --git a/cove-input/src/lib.rs b/cove-input/src/lib.rs index ba3bd63..c15c4c3 100644 --- a/cove-input/src/lib.rs +++ b/cove-input/src/lib.rs @@ -40,7 +40,7 @@ impl<'a> KeyGroupInfo<'a> { } pub struct InputEvent<'a> { - event: crossterm::event::Event, + event: Event, terminal: &'a mut Terminal, crossterm_lock: Arc>, } diff --git a/cove-macro/Cargo.toml b/cove-macro/Cargo.toml index e550ae5..0bda727 100644 --- a/cove-macro/Cargo.toml +++ b/cove-macro/Cargo.toml @@ -4,7 +4,6 @@ version = { workspace = true } edition = { workspace = true } [dependencies] -case = "1.0.0" proc-macro2 = "1.0.83" quote = "1.0.36" syn = "2.0.65" diff --git a/cove-macro/src/key_group.rs b/cove-macro/src/key_group.rs index bc7bdea..84d8cff 100644 --- a/cove-macro/src/key_group.rs +++ b/cove-macro/src/key_group.rs @@ -3,7 +3,7 @@ use quote::quote; use syn::spanned::Spanned; use syn::{Data, DeriveInput}; -use crate::util::{self, bail}; +use crate::util; fn decapitalize(s: &str) -> String { let mut chars = s.chars(); @@ -34,7 +34,7 @@ pub fn derive_impl(input: DeriveInput) -> syn::Result { let default = util::serde_default(field)?; let Some(default) = default else { - return bail(field_ident.span(), "must have serde default"); + return util::bail(field_ident.span(), "must have serde default"); }; let default_value = default.value(); diff --git a/cove/Cargo.toml b/cove/Cargo.toml index ed44f0b..8b9f85a 100644 --- a/cove/Cargo.toml +++ b/cove/Cargo.toml @@ -25,17 +25,12 @@ rusqlite = { version = "0.31.0", features = ["bundled", "time"] } serde_json = "1.0.117" tokio = { version = "1.37.0", features = ["full"] } tz-rs = "0.6.14" -unicode-segmentation = "1.11.0" unicode-width = "0.1.12" [dependencies.time] version = "0.3.36" features = ["macros", "formatting", "parsing", "serde"] -[dependencies.tokio-tungstenite] -version = "0.21.0" -features = ["rustls-tls-native-roots"] - [dependencies.euphoxide] git = "https://github.com/Garmelon/euphoxide.git" tag = "v0.5.1"