Skip to content

Commit

Permalink
Add impl Defaults for clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Pi-Cla committed May 7, 2024
1 parent ef45d6d commit 77328bc
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 0 deletions.
6 changes: 6 additions & 0 deletions luahelper/src/enumctor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ impl<T> Enum<T> {
}
}

impl<T> Default for Enum<T> {
fn default() -> Self {
Self::new()
}
}

impl<T> UserData for Enum<T>
where
T: FromDynamic,
Expand Down
12 changes: 12 additions & 0 deletions promise/src/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,12 @@ impl SimpleExecutor {
}
}

impl Default for SimpleExecutor {
fn default() -> Self {
Self::new()
}
}

pub struct ScopedExecutor {}

impl ScopedExecutor {
Expand All @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions umask/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
6 changes: 6 additions & 0 deletions wezterm-blob-leases/src/lease_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@ impl LeaseId {
self.pid
}
}

impl Default for LeaseId {
fn default() -> Self {
Self::new()
}
}
6 changes: 6 additions & 0 deletions wezterm-input-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions wezterm-ssh/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,12 @@ impl Config {
}
}

impl Default for Config {
fn default() -> Self {
Self::new()
}
}

#[cfg(test)]
mod test {
use super::*;
Expand Down

0 comments on commit 77328bc

Please sign in to comment.