Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
anchpop authored and GREsau committed Jan 13, 2025
1 parent ae4fe29 commit 13ffa14
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
7 changes: 4 additions & 3 deletions schemars/src/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,13 +671,14 @@ where

impl Debug for Box<dyn GenTransform> {
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<T: Send>() {}
fn assert<T: Send>() {}

_assert::<SchemaSettings>();
_assert::<SchemaGenerator>();
assert::<SchemaSettings>();
assert::<SchemaGenerator>();
}
1 change: 0 additions & 1 deletion schemars/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ pub mod r#gen {
///
/// assert_eq!(<GenericType<i32>>::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.
Expand Down
6 changes: 3 additions & 3 deletions schemars_derive/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -63,7 +63,7 @@ impl<'a> Container<'a> {
}
}

impl<'a> Variant<'a> {
impl Variant<'_> {
pub fn name(&self) -> Name {
Name(self.serde_attrs.name())
}
Expand All @@ -85,7 +85,7 @@ impl<'a> Variant<'a> {
}
}

impl<'a> Field<'a> {
impl Field<'_> {
pub fn name(&self) -> Name {
Name(self.serde_attrs.name())
}
Expand Down

0 comments on commit 13ffa14

Please sign in to comment.