1
0
Fork 0
mirror of https://codeberg.org/Codeberg/pages-server.git synced 2025-08-13 19:10:54 +00:00

upgrade to edition 2021, clippy fixes, error fixed

This commit is contained in:
crapStone 2021-10-23 22:57:56 +02:00
parent 6def9f298c
commit b540284764
No known key found for this signature in database
GPG key ID: 0E1380C01B1D51B8
5 changed files with 18 additions and 15 deletions

View file

@ -4,8 +4,6 @@ use std::io::prelude::*;
use std::path::{Path, PathBuf};
use std::process::exit;
use exitcode;
const SYS_PATHS: [&str; 2] = ["/sys/class/backlight", "/sys/class/leds"];
pub trait Controller {
@ -34,7 +32,7 @@ pub struct RawController {
impl RawController {
pub fn new(path: Box<PathBuf>) -> Self {
Self { path: path }
Self { path }
}
}
@ -185,7 +183,7 @@ pub fn get_controllers() -> (String, HashMap<String, Box<PathBuf>>) {
let mut default = None;
for path in SYS_PATHS.iter() {
for path in SYS_PATHS {
if Path::new(path).exists() {
for name in Path::new(path).read_dir().unwrap() {
let name = name.unwrap().path();