ksud: migrate to Rust 2024 edition

This commit is contained in:
weishu
2025-02-24 16:53:37 +08:00
parent e245e3419d
commit 4fdd3e07e5
11 changed files with 30 additions and 27 deletions

View File

@@ -5,11 +5,11 @@ use std::path::PathBuf;
use std::process::Command;
use std::process::Stdio;
use anyhow::Context;
use anyhow::Result;
use anyhow::anyhow;
use anyhow::bail;
use anyhow::ensure;
use anyhow::Context;
use anyhow::Result;
use regex_lite::Regex;
use which::which;
@@ -97,7 +97,7 @@ pub fn get_current_kmi() -> Result<String> {
}
fn parse_kmi_from_kernel(kernel: &PathBuf, workdir: &Path) -> Result<String> {
use std::fs::{copy, File};
use std::fs::{File, copy};
use std::io::{BufReader, Read};
let kernel_path = workdir.join("kernel");
copy(kernel, &kernel_path).context("Failed to copy kernel")?;