From ba5a858034ff2d509d44a65f463d82759c289a97 Mon Sep 17 00:00:00 2001 From: Sebastian Czapla Date: Fri, 13 Dec 2024 11:43:41 +0100 Subject: [PATCH 1/2] tool/src/main.rs: Allow non utf8 arguments within fan subcmd Signed-off-by: Sebastian Czapla --- tool/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tool/src/main.rs b/tool/src/main.rs index 71090c78e..85b0ae995 100644 --- a/tool/src/main.rs +++ b/tool/src/main.rs @@ -311,7 +311,7 @@ fn main() { .subcommand(SubCommand::with_name("console")) .subcommand(SubCommand::with_name("fan") .arg(Arg::with_name("index") - .value_parser(clap::value_parser!(u8)) + .allow_invalid_utf8(true) .required(true) ) .arg(Arg::with_name("duty") @@ -456,7 +456,7 @@ fn main() { }, }, Some(("fan", sub_m)) => { - let index = sub_m.value_of("index").unwrap().parse::().unwrap(); + let index = sub_m.value_of_os("index").unwrap().to_string_lossy().parse::().unwrap(); let duty_opt = sub_m.value_of("duty").map(|x| x.parse::().unwrap()); match duty_opt { Some(duty) => match unsafe { fan_set(&mut ec, index, duty) } { From 281293790b0209d98da7550fa0568c99a1e71168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kope=C4=87?= Date: Fri, 13 Dec 2024 12:47:52 +0100 Subject: [PATCH 2/2] .pre-commit-config.yaml: update clang-format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Kopeć --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f89b186a9..5d1dfa2d8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: args: ["--severity=warning"] - repo: https://github.com/pre-commit/mirrors-clang-format - rev: 'v18.1.6' # Use the sha / tag you want to point at + rev: 'v19.1.0' # Use the sha / tag you want to point at hooks: - id: clang-format