Skip to content
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
9 changes: 2 additions & 7 deletions tower-http/src/cors/allow_credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,12 @@ impl fmt::Debug for AllowCredentials {
}
}

#[derive(Clone)]
#[derive(Clone, Default)]
enum AllowCredentialsInner {
Yes,
#[default]
No,
Predicate(
Arc<dyn for<'a> Fn(&'a HeaderValue, &'a RequestParts) -> bool + Send + Sync + 'static>,
),
}

impl Default for AllowCredentialsInner {
fn default() -> Self {
Self::No
}
}
9 changes: 2 additions & 7 deletions tower-http/src/cors/allow_private_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,16 @@ impl fmt::Debug for AllowPrivateNetwork {
}
}

#[derive(Clone)]
#[derive(Clone, Default)]
enum AllowPrivateNetworkInner {
Yes,
#[default]
No,
Predicate(
Arc<dyn for<'a> Fn(&'a HeaderValue, &'a RequestParts) -> bool + Send + Sync + 'static>,
),
}

impl Default for AllowPrivateNetworkInner {
fn default() -> Self {
Self::No
}
}

#[cfg(test)]
mod tests {
#![allow(
Expand Down
3 changes: 1 addition & 2 deletions tower-http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
clippy::all,
clippy::dbg_macro,
clippy::todo,
clippy::empty_enum,
clippy::empty_enums,
clippy::enum_glob_use,
clippy::mem_forget,
clippy::unused_self,
Expand All @@ -173,7 +173,6 @@
clippy::match_wildcard_for_single_variants,
clippy::if_let_mutex,
clippy::await_holding_lock,
clippy::match_on_vec_items,
clippy::imprecise_flops,
clippy::suboptimal_flops,
clippy::lossy_float_literal,
Expand Down
Loading