From 13ffa14d1f65bbcc85e1f5c24fc8d8c7c36fb381 Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Fri, 27 Dec 2024 14:47:15 -0600 Subject: [PATCH] Fix clippy lints --- schemars/src/generate.rs | 7 ++++--- schemars/src/lib.rs | 1 - schemars_derive/src/ast/mod.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/schemars/src/generate.rs b/schemars/src/generate.rs index 375fa08d..498d3b47 100644 --- a/schemars/src/generate.rs +++ b/schemars/src/generate.rs @@ -671,13 +671,14 @@ where impl Debug for Box { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + #[allow(clippy::used_underscore_items)] self._debug_type_name(f) } } fn _assert_send() { - fn _assert() {} + fn assert() {} - _assert::(); - _assert::(); + assert::(); + assert::(); } diff --git a/schemars/src/lib.rs b/schemars/src/lib.rs index b516c6fb..b62a153c 100644 --- a/schemars/src/lib.rs +++ b/schemars/src/lib.rs @@ -145,7 +145,6 @@ pub mod r#gen { /// /// assert_eq!(>::schema_id(), <&mut GenericType<&i32>>::schema_id()); /// ``` - pub trait JsonSchema { /// Whether JSON Schemas generated for this type should be included directly in parent schemas, /// rather than being re-used where possible using the `$ref` keyword. diff --git a/schemars_derive/src/ast/mod.rs b/schemars_derive/src/ast/mod.rs index 9e632c5b..c0989599 100644 --- a/schemars_derive/src/ast/mod.rs +++ b/schemars_derive/src/ast/mod.rs @@ -48,7 +48,7 @@ impl<'a> Container<'a> { .map(|_| result.expect("from_ast set no errors on Ctxt, so should have returned Ok")) } - pub fn transparent_field(&'a self) -> Option<&'a Field> { + pub fn transparent_field(&'a self) -> Option<&'a Field<'a>> { if self.serde_attrs.transparent() { if let Data::Struct(_, fields) = &self.data { return Some(&fields[0]); @@ -63,7 +63,7 @@ impl<'a> Container<'a> { } } -impl<'a> Variant<'a> { +impl Variant<'_> { pub fn name(&self) -> Name { Name(self.serde_attrs.name()) } @@ -85,7 +85,7 @@ impl<'a> Variant<'a> { } } -impl<'a> Field<'a> { +impl Field<'_> { pub fn name(&self) -> Name { Name(self.serde_attrs.name()) }