From 12980dd88fb951d26c26a80c251b29a921a3cf21 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 4 Mar 2024 11:47:07 -0500 Subject: [PATCH] Enable `clippy::derivable_impls` (#8836) This PR enables the [`clippy::derivable_impls`](https://rust-lang.github.io/rust-clippy/master/index.html#/derivable_impls) rule and fixes the outstanding violations. Release Notes: - N/A --- crates/ai/src/test.rs | 9 +-------- tooling/xtask/src/main.rs | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/crates/ai/src/test.rs b/crates/ai/src/test.rs index 89edc71b0b..f10ca4f5fa 100644 --- a/crates/ai/src/test.rs +++ b/crates/ai/src/test.rs @@ -54,6 +54,7 @@ impl LanguageModel for FakeLanguageModel { } } +#[derive(Default)] pub struct FakeEmbeddingProvider { pub embedding_count: AtomicUsize, } @@ -66,14 +67,6 @@ impl Clone for FakeEmbeddingProvider { } } -impl Default for FakeEmbeddingProvider { - fn default() -> Self { - FakeEmbeddingProvider { - embedding_count: AtomicUsize::default(), - } - } -} - impl FakeEmbeddingProvider { pub fn embedding_count(&self) -> usize { self.embedding_count.load(atomic::Ordering::SeqCst) diff --git a/tooling/xtask/src/main.rs b/tooling/xtask/src/main.rs index e40a92c0a0..1f075c59d4 100644 --- a/tooling/xtask/src/main.rs +++ b/tooling/xtask/src/main.rs @@ -85,7 +85,6 @@ fn run_clippy(args: ClippyArgs) -> Result<()> { "clippy::cast_abs_to_unsigned", "clippy::cmp_owned", "clippy::crate_in_macro_def", - "clippy::derivable_impls", "clippy::derive_ord_xor_partial_ord", "clippy::eq_op", "clippy::implied_bounds_in_impls",