Skip to content

Commit c4fd455

Browse files
committed
Fix clippy
1 parent 7cd6e26 commit c4fd455

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

src/config.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -753,26 +753,21 @@ impl<Scope: private::ConfigScope> ConfigBuilder<Scope> {
753753
/// * `None` no automatic header
754754
/// * `Default` default behavior. I.e. for user-agent something like `ureq/3.1.2`
755755
/// * `Provided` is a user provided header
756-
#[derive(Debug, Clone)]
756+
#[derive(Debug, Clone, Default)]
757757
pub enum AutoHeaderValue {
758758
/// No automatic header.
759759
None,
760760

761761
/// Default behavior.
762762
///
763763
/// I.e. for user-agent something like `ureq/3.1.2`.
764+
#[default]
764765
Default,
765766

766767
/// User provided header value.
767768
Provided(Arc<String>),
768769
}
769770

770-
impl Default for AutoHeaderValue {
771-
fn default() -> Self {
772-
Self::Default
773-
}
774-
}
775-
776771
impl AutoHeaderValue {
777772
pub(crate) fn as_str(&self, default: &'static str) -> Option<&str> {
778773
let x = match self {

src/tls/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub(crate) mod native_tls;
1919
/// Defaults to [`Rustls`][Self::Rustls] because this has the highest chance
2020
/// to compile and "just work" straight out of the box without installing additional
2121
/// development dependencies.
22-
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
22+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
2323
#[non_exhaustive]
2424
pub enum TlsProvider {
2525
/// [Rustls](https://crates.io/crates/rustls) with the
@@ -29,6 +29,7 @@ pub enum TlsProvider {
2929
/// Requires the feature flag **rustls**.
3030
///
3131
/// This is the default.
32+
#[default]
3233
Rustls,
3334

3435
/// [Native-TLS](https://crates.io/crates/native-tls) for cases where it's important to
@@ -338,12 +339,6 @@ impl Default for TlsConfig {
338339
}
339340
}
340341

341-
impl Default for TlsProvider {
342-
fn default() -> Self {
343-
Self::Rustls
344-
}
345-
}
346-
347342
impl fmt::Debug for TlsConfig {
348343
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
349344
f.debug_struct("TlsConfig")

0 commit comments

Comments
 (0)