Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix clippy lints #360

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading