ksud: fix clippy warning/error

This commit is contained in:
rifsxd
2025-05-23 00:47:56 +06:00
parent 1ee737b1aa
commit fec0032883
3 changed files with 7 additions and 14 deletions

View File

@@ -14,7 +14,7 @@ fn get_git_version() -> Result<(u32, String), std::io::Error> {
let version_code: u32 = version_code let version_code: u32 = version_code
.trim() .trim()
.parse() .parse()
.map_err(|_| std::io::Error::new(std::io::ErrorKind::Other, "Failed to parse git count"))?; .map_err(|_| std::io::Error::other("Failed to parse git count"))?;
let version_code = 10000 + 200 + version_code; // For historical reasons let version_code = 10000 + 200 + version_code; // For historical reasons
let version_name = String::from_utf8( let version_name = String::from_utf8(
@@ -23,12 +23,8 @@ fn get_git_version() -> Result<(u32, String), std::io::Error> {
.output()? .output()?
.stdout, .stdout,
) )
.map_err(|_| { .map_err(|_| std::io::Error::other("Failed to read git describe stdout"))?;
std::io::Error::new(
std::io::ErrorKind::Other,
"Failed to read git describe stdout",
)
})?;
let version_name = version_name.trim_start_matches('v').to_string(); let version_name = version_name.trim_start_matches('v').to_string();
Ok((version_code, version_name)) Ok((version_code, version_name))
} }

View File

@@ -14,7 +14,7 @@ fn get_git_version() -> Result<(u32, String), std::io::Error> {
let version_code: u32 = version_code let version_code: u32 = version_code
.trim() .trim()
.parse() .parse()
.map_err(|_| std::io::Error::new(std::io::ErrorKind::Other, "Failed to parse git count"))?; .map_err(|_| std::io::Error::other("Failed to parse git count"))?;
let version_code = 10000 + 200 + version_code; // For historical reasons let version_code = 10000 + 200 + version_code; // For historical reasons
let version_name = String::from_utf8( let version_name = String::from_utf8(
@@ -23,12 +23,8 @@ fn get_git_version() -> Result<(u32, String), std::io::Error> {
.output()? .output()?
.stdout, .stdout,
) )
.map_err(|_| { .map_err(|_| std::io::Error::other("Failed to read git describe stdout"))?;
std::io::Error::new(
std::io::ErrorKind::Other,
"Failed to read git describe stdout",
)
})?;
let version_name = version_name.trim_start_matches('v').to_string(); let version_name = version_name.trim_start_matches('v').to_string();
Ok((version_code, version_name)) Ok((version_code, version_name))
} }

View File

@@ -192,6 +192,7 @@ fn is_ok_empty(dir: &str) -> bool {
} }
} }
#[allow(deprecated)]
fn find_temp_path() -> String { fn find_temp_path() -> String {
use std::result::Result::Ok; use std::result::Result::Ok;