Skip to content

Commit

Permalink
chore: fix clippy (#341)
Browse files Browse the repository at this point in the history
* fix copy

* fix clippy
  • Loading branch information
SWvheerden committed May 10, 2024
1 parent 94e3548 commit 5c4a9cc
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion libs/protocol/src/settings.rs
Expand Up @@ -168,7 +168,7 @@ impl PersistentSettings {
self.new_sha3_miner_settings();
}
if let Some(s) = self.sha3_miner.as_mut() {
s.wallet_payment_address = address.clone()
s.wallet_payment_address.clone_from(&address)
}

if self.mm_proxy.is_none() {
Expand Down
3 changes: 2 additions & 1 deletion libs/sdm-launchpad/src/resources/images/l5_mmproxy.rs
Expand Up @@ -74,7 +74,8 @@ impl ManagedContainer for MmProxy {
None
});
let session = &self.settings.as_ref()?.session;
self.mm_proxy = config?.settings.as_ref()?.saved_settings.mm_proxy.clone();
self.mm_proxy
.clone_from(&config?.settings.as_ref()?.saved_settings.mm_proxy);
self.mm_proxy = match config?.settings {
Some(ref settings) if settings.saved_settings.mm_proxy.is_none() => {
info!("No MM proxy settings found for the container configuration. Falling back on defaults.");
Expand Down
2 changes: 1 addition & 1 deletion libs/sdm-launchpad/src/resources/images/l5_xmrig.rs
Expand Up @@ -68,7 +68,7 @@ impl ManagedContainer for XMRig {
self.settings = ConnectionSettings::try_extract(config?);
let session = &self.settings.as_ref()?.session;

self.xmrig = config?.settings.as_ref()?.saved_settings.xmrig.clone();
self.xmrig.clone_from(&config?.settings.as_ref()?.saved_settings.xmrig);
self.xmrig.as_ref()?;

Some(session.is_xmrig_active())
Expand Down
4 changes: 1 addition & 3 deletions libs/sdm/src/image/task/mod.rs
Expand Up @@ -33,7 +33,7 @@ use super::{checker::CheckerEvent, ManagedContainer};
use crate::{
config::ManagedProtocol,
error::ParseError,
task::{RunnableContext, RunnableTask, TaskContext, TaskEvent, TaskStatusChecker},
task::{RunnableContext, RunnableTask, TaskContext, TaskStatusChecker},
utils::TaskGuard,
};

Expand Down Expand Up @@ -178,8 +178,6 @@ pub enum Event {
CheckerProgress(CheckerEvent),
}

impl TaskEvent for Event {}

impl TryFrom<String> for Event {
type Error = ParseError;

Expand Down
4 changes: 1 addition & 3 deletions libs/sdm/src/network/task/mod.rs
Expand Up @@ -32,7 +32,7 @@ use super::ManagedNetwork;
use crate::{
config::ManagedProtocol,
error::ParseError,
task::{RunnableContext, RunnableTask, TaskContext, TaskEvent, TaskStatusChecker},
task::{RunnableContext, RunnableTask, TaskContext, TaskStatusChecker},
utils::TaskGuard,
};

Expand Down Expand Up @@ -119,8 +119,6 @@ pub enum Event {
Created,
}

impl TaskEvent for Event {}

impl TryFrom<String> for Event {
type Error = ParseError;

Expand Down
4 changes: 1 addition & 3 deletions libs/sdm/src/task.rs
Expand Up @@ -65,7 +65,7 @@ pub trait TaskStatusChecker: fmt::Debug + Default + Send {
pub trait RunnableTask: Sized + Send + 'static {
type Protocol: ManagedProtocol;
type Status: TaskStatusChecker;
type Event: TaskEvent;
type Event: fmt::Debug;

fn name(&self) -> &str;

Expand Down Expand Up @@ -428,5 +428,3 @@ where
}
}
}

pub trait TaskEvent: fmt::Debug + Send {}
4 changes: 1 addition & 3 deletions libs/sdm/src/volume/task/mod.rs
Expand Up @@ -32,7 +32,7 @@ use super::ManagedVolume;
use crate::{
config::ManagedProtocol,
error::ParseError,
task::{RunnableContext, RunnableTask, TaskContext, TaskEvent, TaskStatusChecker},
task::{RunnableContext, RunnableTask, TaskContext, TaskStatusChecker},
utils::TaskGuard,
};

Expand Down Expand Up @@ -118,8 +118,6 @@ pub enum Event {
Created,
}

impl TaskEvent for Event {}

impl TryFrom<String> for Event {
type Error = ParseError;

Expand Down

0 comments on commit 5c4a9cc

Please sign in to comment.