From 77328bc715c6410dbb7386936606d228cb19f985 Mon Sep 17 00:00:00 2001 From: Pi-Cla Date: Mon, 6 May 2024 23:14:11 -0600 Subject: [PATCH] Add impl Defaults for clippy --- luahelper/src/enumctor.rs | 6 ++++++ promise/src/spawn.rs | 12 ++++++++++++ umask/src/lib.rs | 6 ++++++ wezterm-blob-leases/src/lease_id.rs | 6 ++++++ wezterm-input-types/src/lib.rs | 6 ++++++ wezterm-ssh/src/config.rs | 6 ++++++ 6 files changed, 42 insertions(+) diff --git a/luahelper/src/enumctor.rs b/luahelper/src/enumctor.rs index c62442543bf..32241288404 100644 --- a/luahelper/src/enumctor.rs +++ b/luahelper/src/enumctor.rs @@ -109,6 +109,12 @@ impl Enum { } } +impl Default for Enum { + fn default() -> Self { + Self::new() + } +} + impl UserData for Enum where T: FromDynamic, diff --git a/promise/src/spawn.rs b/promise/src/spawn.rs index 16fc553a8c6..5e5ab6eeaba 100644 --- a/promise/src/spawn.rs +++ b/promise/src/spawn.rs @@ -223,6 +223,12 @@ impl SimpleExecutor { } } +impl Default for SimpleExecutor { + fn default() -> Self { + Self::new() + } +} + pub struct ScopedExecutor {} impl ScopedExecutor { @@ -243,6 +249,12 @@ impl ScopedExecutor { } } +impl Default for ScopedExecutor { + fn default() -> Self { + Self::new() + } +} + impl Drop for ScopedExecutor { fn drop(&mut self) { SCOPED_EXECUTOR.lock().unwrap().take(); diff --git a/umask/src/lib.rs b/umask/src/lib.rs index 574b20806d5..a1d09309166 100644 --- a/umask/src/lib.rs +++ b/umask/src/lib.rs @@ -44,6 +44,12 @@ impl UmaskSaver { } } +impl Default for UmaskSaver { + fn default() -> Self { + Self::new() + } +} + impl Drop for UmaskSaver { fn drop(&mut self) { #[cfg(unix)] diff --git a/wezterm-blob-leases/src/lease_id.rs b/wezterm-blob-leases/src/lease_id.rs index 0583e0c4dd3..bff7730774c 100644 --- a/wezterm-blob-leases/src/lease_id.rs +++ b/wezterm-blob-leases/src/lease_id.rs @@ -37,3 +37,9 @@ impl LeaseId { self.pid } } + +impl Default for LeaseId { + fn default() -> Self { + Self::new() + } +} diff --git a/wezterm-input-types/src/lib.rs b/wezterm-input-types/src/lib.rs index c7d0e960f5c..c185ace7248 100644 --- a/wezterm-input-types/src/lib.rs +++ b/wezterm-input-types/src/lib.rs @@ -1228,6 +1228,12 @@ impl Handled { } } +impl Default for Handled { + fn default() -> Self { + Self::new() + } +} + impl PartialEq for Handled { fn eq(&self, _: &Self) -> bool { true diff --git a/wezterm-ssh/src/config.rs b/wezterm-ssh/src/config.rs index 5585f61b234..6f7ded34cf2 100644 --- a/wezterm-ssh/src/config.rs +++ b/wezterm-ssh/src/config.rs @@ -751,6 +751,12 @@ impl Config { } } +impl Default for Config { + fn default() -> Self { + Self::new() + } +} + #[cfg(test)] mod test { use super::*;