fix: resolve synor-compute clippy warnings
- Replace .clone() with dereference for Copy types - Use #[derive(Default)] with #[default] attribute instead of manual impl
This commit is contained in:
parent
e24ce116d7
commit
88b09914c3
4 changed files with 9 additions and 22 deletions
|
|
@ -209,11 +209,12 @@ pub enum FunctionRuntime {
|
|||
}
|
||||
|
||||
/// Job priority levels.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
|
||||
pub enum JobPriority {
|
||||
/// Background job, can be preempted.
|
||||
Background = 0,
|
||||
/// Normal priority.
|
||||
#[default]
|
||||
Normal = 1,
|
||||
/// High priority, faster scheduling.
|
||||
High = 2,
|
||||
|
|
@ -221,12 +222,6 @@ pub enum JobPriority {
|
|||
Critical = 3,
|
||||
}
|
||||
|
||||
impl Default for JobPriority {
|
||||
fn default() -> Self {
|
||||
JobPriority::Normal
|
||||
}
|
||||
}
|
||||
|
||||
/// Resource requirements for a job.
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||
pub struct ResourceRequirements {
|
||||
|
|
|
|||
|
|
@ -495,7 +495,7 @@ impl OrderBook {
|
|||
pub fn mid_price(&self) -> Option<f64> {
|
||||
match (self.best_bid(), self.best_ask()) {
|
||||
(Some(bid), Some(ask)) => Some((bid + ask) / 2.0),
|
||||
_ => self.last_price.read().clone(),
|
||||
_ => *self.last_price.read(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,13 +17,14 @@ use std::sync::Arc;
|
|||
use std::time::{Duration, Instant};
|
||||
|
||||
/// Balancing strategy for the load balancer.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
pub enum BalancingStrategy {
|
||||
/// Optimize for speed (minimize execution time).
|
||||
Speed,
|
||||
/// Optimize for energy efficiency.
|
||||
Energy,
|
||||
/// Balance speed and energy.
|
||||
#[default]
|
||||
Balanced,
|
||||
/// Optimize for cost (spot pricing).
|
||||
Cost,
|
||||
|
|
@ -31,12 +32,6 @@ pub enum BalancingStrategy {
|
|||
Latency,
|
||||
}
|
||||
|
||||
impl Default for BalancingStrategy {
|
||||
fn default() -> Self {
|
||||
BalancingStrategy::Balanced
|
||||
}
|
||||
}
|
||||
|
||||
/// Real-time processor metrics.
|
||||
#[derive(Clone, Debug, Default)]
|
||||
pub struct ProcessorMetrics {
|
||||
|
|
|
|||
|
|
@ -31,11 +31,14 @@ impl std::fmt::Display for TaskId {
|
|||
}
|
||||
|
||||
/// Task priority levels.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
|
||||
#[derive(
|
||||
Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize,
|
||||
)]
|
||||
pub enum TaskPriority {
|
||||
/// Background, can be preempted.
|
||||
Background = 0,
|
||||
/// Normal priority.
|
||||
#[default]
|
||||
Normal = 1,
|
||||
/// High priority.
|
||||
High = 2,
|
||||
|
|
@ -43,12 +46,6 @@ pub enum TaskPriority {
|
|||
Critical = 3,
|
||||
}
|
||||
|
||||
impl Default for TaskPriority {
|
||||
fn default() -> Self {
|
||||
TaskPriority::Normal
|
||||
}
|
||||
}
|
||||
|
||||
/// Task execution status.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub enum TaskStatus {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue