Clippy fixed. Fix openrc files

This commit is contained in:
Adrian Woźniak 2021-12-07 16:12:15 +01:00
parent 0b388e2ae3
commit 24ccf0d59f
No known key found for this signature in database
GPG Key ID: 0012845A89C7352B
9 changed files with 21 additions and 21 deletions

View File

@ -3,8 +3,8 @@ use gumdrop::Options;
use amdgpu::utils::hw_mons;
use amdgpu_config::fan::Config;
use crate::{AmdFanError, FanMode};
use crate::command::Fan;
use crate::{AmdFanError, FanMode};
/// Change card fan mode to either automatic or manual
pub fn run(switcher: Switcher, mode: FanMode, config: Config) -> crate::Result<()> {

View File

@ -11,7 +11,7 @@ pub fn restore_automatic() {
pwm_min: None,
pwm_max: None,
})
.write_automatic()
.write_automatic()
{
log::error!("{}", error);
}

View File

@ -3,8 +3,8 @@ use gumdrop::Options;
use amdgpu::utils::hw_mons;
use amdgpu_config::fan::Config;
use crate::AmdFanError;
use crate::command::Fan;
use crate::AmdFanError;
/// Start service which will change fan speed according to config and GPU temperature
pub fn run(config: Config) -> crate::Result<()> {

View File

@ -30,8 +30,8 @@ impl std::str::FromStr for Card {
impl<'de> Deserialize<'de> for Card {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
where
D: serde::Deserializer<'de>,
{
use serde::de::{self, Visitor};
@ -45,8 +45,8 @@ impl<'de> Deserialize<'de> for Card {
}
fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
where
E: de::Error,
where
E: de::Error,
{
match value.parse::<Card>() {
Ok(card) => Ok(*card),
@ -68,8 +68,8 @@ impl<'de> Deserialize<'de> for Card {
impl serde::Serialize for Card {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
where
S: serde::Serializer,
{
serializer.serialize_str(&self.to_string())
}

View File

@ -37,8 +37,8 @@ impl std::str::FromStr for TempInput {
impl<'de> serde::Deserialize<'de> for TempInput {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
where
D: serde::Deserializer<'de>,
{
use serde::de::{self, Visitor};
@ -52,8 +52,8 @@ impl<'de> serde::Deserialize<'de> for TempInput {
}
fn visit_str<E>(self, value: &str) -> Result<Self::Value, E>
where
E: de::Error,
where
E: de::Error,
{
match value.parse::<TempInput>() {
Ok(temp) => Ok(temp.0),

View File

@ -1,7 +1,7 @@
use std::io::ErrorKind;
use crate::{Card, CONFIG_DIR, hw_mon, ROOT_DIR};
use crate::hw_mon::HwMon;
use crate::{hw_mon, Card, CONFIG_DIR, ROOT_DIR};
/// linear mapping from the xrange to the yrange
pub fn linear_map(x: f64, x1: f64, x2: f64, y1: f64, y2: f64) -> f64 {
@ -45,10 +45,10 @@ pub fn hw_mons(filter: bool) -> std::io::Result<Vec<HwMon>> {
}
pub fn ensure_config<Config, Error, P>(config_path: P) -> std::result::Result<Config, Error>
where
Config: serde::Serialize + serde::de::DeserializeOwned + Default + Sized,
P: AsRef<std::path::Path>,
Error: From<std::io::Error>,
where
Config: serde::Serialize + serde::de::DeserializeOwned + Default + Sized,
P: AsRef<std::path::Path>,
Error: From<std::io::Error>,
{
match std::fs::read_to_string(&config_path) {
Ok(s) => Ok(toml::from_str::<Config>(s.as_str()).unwrap()),

View File

@ -1,7 +1,7 @@
use amdgpu::utils::hw_mons;
use crate::{Config, VoltageError};
use crate::command::VoltageManipulator;
use crate::{Config, VoltageError};
#[derive(Debug, gumdrop::Options)]
pub struct ApplyChanges {

View File

@ -1,11 +1,11 @@
use amdgpu::hw_mon::HwMon;
use crate::{Config, VoltageError};
use crate::apply_changes::ApplyChanges;
use crate::change_state::ChangeState;
use crate::clock_state::{ClockState, Frequency, Voltage};
use crate::print_states::PrintStates;
use crate::setup_info::SetupInfo;
use crate::{Config, VoltageError};
#[derive(Debug)]
pub enum HardwareModule {

View File

@ -1,7 +1,7 @@
use gumdrop::Options;
use amdgpu::utils::ensure_config_dir;
use amdgpu_config::voltage::{Config, load_config};
use amdgpu_config::voltage::{load_config, Config};
use crate::command::VoltageCommand;
use crate::error::VoltageError;