Skip to content

Commit a9c6053

Browse files
committed
digital_io: test: 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 1330d1a commit a9c6053

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/backlight/demo_mode.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use std::str::{from_utf8, FromStr};
2222
use sysfs_class::{set_trait_method, trait_method};
2323

2424
pub trait SysClass: Sized {
25-
fn class() -> &'static str;
2625
unsafe fn from_path_unchecked(path: PathBuf) -> Self;
2726
fn path(&self) -> &Path;
2827

@@ -60,7 +59,6 @@ pub trait SysClass: Sized {
6059
}
6160

6261
pub trait Brightness {
63-
fn brightness(&self) -> Result<u64>;
6462
fn max_brightness(&self) -> Result<u64>;
6563
fn set_brightness(&self, val: u64) -> Result<()>;
6664
}
@@ -70,10 +68,6 @@ pub struct Backlight {
7068
}
7169

7270
impl SysClass for Backlight {
73-
fn class() -> &'static str {
74-
"backlight"
75-
}
76-
7771
unsafe fn from_path_unchecked(path: PathBuf) -> Self {
7872
Self { path }
7973
}
@@ -84,7 +78,6 @@ impl SysClass for Backlight {
8478
}
8579

8680
impl Brightness for Backlight {
87-
trait_method!(brightness parse_file u64);
8881
trait_method!(max_brightness parse_file u64);
8982
set_trait_method!("brightness", set_brightness u64);
9083
}

0 commit comments

Comments
 (0)