Skip to content

Commit 812aa6f

Browse files
alexanderkjallbarjin
authored andcommitted
Fix clippy warnings (tower-rs#659)
1 parent 2042173 commit 812aa6f

3 files changed

Lines changed: 5 additions & 16 deletions

File tree

tower-http/src/cors/allow_credentials.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,12 @@ impl fmt::Debug for AllowCredentials {
8080
}
8181
}
8282

83-
#[derive(Clone)]
83+
#[derive(Clone, Default)]
8484
enum AllowCredentialsInner {
8585
Yes,
86+
#[default]
8687
No,
8788
Predicate(
8889
Arc<dyn for<'a> Fn(&'a HeaderValue, &'a RequestParts) -> bool + Send + Sync + 'static>,
8990
),
9091
}
91-
92-
impl Default for AllowCredentialsInner {
93-
fn default() -> Self {
94-
Self::No
95-
}
96-
}

tower-http/src/cors/allow_private_network.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,16 @@ impl fmt::Debug for AllowPrivateNetwork {
9898
}
9999
}
100100

101-
#[derive(Clone)]
101+
#[derive(Clone, Default)]
102102
enum AllowPrivateNetworkInner {
103103
Yes,
104+
#[default]
104105
No,
105106
Predicate(
106107
Arc<dyn for<'a> Fn(&'a HeaderValue, &'a RequestParts) -> bool + Send + Sync + 'static>,
107108
),
108109
}
109110

110-
impl Default for AllowPrivateNetworkInner {
111-
fn default() -> Self {
112-
Self::No
113-
}
114-
}
115-
116111
#[cfg(test)]
117112
mod tests {
118113
#![allow(

tower-http/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
clippy::all,
164164
clippy::dbg_macro,
165165
clippy::todo,
166-
clippy::empty_enum,
166+
clippy::empty_enums,
167167
clippy::enum_glob_use,
168168
clippy::mem_forget,
169169
clippy::unused_self,
@@ -173,7 +173,6 @@
173173
clippy::match_wildcard_for_single_variants,
174174
clippy::if_let_mutex,
175175
clippy::await_holding_lock,
176-
clippy::match_on_vec_items,
177176
clippy::imprecise_flops,
178177
clippy::suboptimal_flops,
179178
clippy::lossy_float_literal,

0 commit comments

Comments
 (0)