From c2916e87a5f7de625c20f50fdaf42514e44533c0 Mon Sep 17 00:00:00 2001 From: Chrislearn Young Date: Wed, 29 Nov 2023 13:02:59 +0800 Subject: [PATCH] cargo clippy --- crates/oapi-macros/src/schema/flattened_map_schema.rs | 2 +- crates/serve-static/src/dir.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/oapi-macros/src/schema/flattened_map_schema.rs b/crates/oapi-macros/src/schema/flattened_map_schema.rs index 5e4fc7e61..e38ac4058 100644 --- a/crates/oapi-macros/src/schema/flattened_map_schema.rs +++ b/crates/oapi-macros/src/schema/flattened_map_schema.rs @@ -8,7 +8,7 @@ pub(crate) struct FlattenedMapSchema { tokens: TokenStream, } -impl<'c> FlattenedMapSchema { +impl FlattenedMapSchema { pub(crate) fn new( ComponentSchemaProps { type_tree, diff --git a/crates/serve-static/src/dir.rs b/crates/serve-static/src/dir.rs index 590fed487..d40c85a28 100644 --- a/crates/serve-static/src/dir.rs +++ b/crates/serve-static/src/dir.rs @@ -133,6 +133,7 @@ pub struct StaticDir { pub chunk_size: Option, /// List dot files. pub include_dot_files: bool, + #[allow(clippy::type_complexity)] exclude_filters: Vec bool + Send + Sync>>, /// Auto list the directory if default file not found. pub auto_list: bool, @@ -421,7 +422,7 @@ impl Handler for StaticDir { if let Ok(mut entries) = tokio::fs::read_dir(&abs_path).await { while let Ok(Some(entry)) = entries.next_entry().await { let file_name = entry.file_name().to_string_lossy().to_string(); - if self.include_dot_files || (!self.include_dot_files && !file_name.starts_with('.')) { + if self.include_dot_files || !file_name.starts_with('.') { if let Ok(metadata) = entry.metadata().await { if metadata.is_dir() { dirs.entry(file_name).or_insert(metadata);