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:
parent
6def9f298c
commit
b540284764
5 changed files with 18 additions and 15 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue