Skip to content

Commit bce0350

Browse files
committed
led: demo_mode: remove unused trait methods
The mock trait is based on one provided by the sysfs_class crate. But we do not actually use some of the methods it has, so we can remove their implementation. This change was suggested by cargo clippy. Signed-off-by: Leonard Göhrs <[email protected]>
1 parent a9c6053 commit bce0350

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/led/demo_mode.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::io::{Error, ErrorKind, Result};
1919
use std::path::{Path, PathBuf};
2020
use std::str::{from_utf8, FromStr};
2121

22-
use sysfs_class::{set_trait_method, trait_method};
22+
use sysfs_class::trait_method;
2323

2424
const FILES_READ: &[(&str, &str)] = &[
2525
("tac:green:out0/max_brightness", "1"),
@@ -30,7 +30,6 @@ const FILES_READ: &[(&str, &str)] = &[
3030
];
3131

3232
pub trait SysClass: Sized {
33-
fn class() -> &'static str;
3433
unsafe fn from_path_unchecked(path: PathBuf) -> Self;
3534
fn path(&self) -> &Path;
3635

@@ -68,20 +67,14 @@ pub trait SysClass: Sized {
6867
}
6968

7069
pub trait Brightness {
71-
fn brightness(&self) -> Result<u64>;
7270
fn max_brightness(&self) -> Result<u64>;
73-
fn set_brightness(&self, val: u64) -> Result<()>;
7471
}
7572

7673
pub struct Leds {
7774
path: PathBuf,
7875
}
7976

8077
impl SysClass for Leds {
81-
fn class() -> &'static str {
82-
"leds"
83-
}
84-
8578
unsafe fn from_path_unchecked(path: PathBuf) -> Self {
8679
Self { path }
8780
}
@@ -92,7 +85,5 @@ impl SysClass for Leds {
9285
}
9386

9487
impl Brightness for Leds {
95-
trait_method!(brightness parse_file u64);
9688
trait_method!(max_brightness parse_file u64);
97-
set_trait_method!("brightness", set_brightness u64);
9889
}

0 commit comments

Comments
 (0)