cargo fmt

This commit is contained in:
lubeilin
2023-09-03 11:39:30 +08:00
parent acb5a8a325
commit c3cff7c5b5
94 changed files with 2976 additions and 1958 deletions
+1 -1
View File
@@ -76,4 +76,4 @@ pub fn to_ip(mask: &str) -> Result<u32, String> {
} else {
Err("not netmask".to_string())
}
}
}
+12 -9
View File
@@ -1,4 +1,3 @@
use std::process::Command;
#[cfg(target_os = "windows")]
@@ -7,8 +6,9 @@ pub fn get_unique_identifier() -> Option<String> {
let output = match Command::new("wmic")
.creation_flags(0x08000000)
.args(&["csproduct", "get", "UUID"])
.output() {
Ok(output) => { output }
.output()
{
Ok(output) => output,
Err(_) => {
return None;
}
@@ -27,8 +27,9 @@ pub fn get_unique_identifier() -> Option<String> {
pub fn get_unique_identifier() -> Option<String> {
let output = match Command::new("ioreg")
.args(&["-rd1", "-c", "IOPlatformExpertDevice"])
.output() {
Ok(output) => { output }
.output()
{
Ok(output) => output,
Err(_) => {
return None;
}
@@ -38,7 +39,8 @@ pub fn get_unique_identifier() -> Option<String> {
let identifier = result
.lines()
.find(|line| line.contains("IOPlatformUUID"))
.unwrap_or("").trim();
.unwrap_or("")
.trim();
if identifier.is_empty() {
None
} else {
@@ -51,8 +53,9 @@ pub fn get_unique_identifier() -> Option<String> {
let output = match Command::new("dmidecode")
.arg("-s")
.arg("system-uuid")
.output() {
Ok(output) => { output }
.output()
{
Ok(output) => output,
Err(_) => {
return None;
}
@@ -65,4 +68,4 @@ pub fn get_unique_identifier() -> Option<String> {
} else {
Some(identifier.to_string())
}
}
}
+1 -1
View File
@@ -1,2 +1,2 @@
pub mod identifier;
pub mod args_parse;
pub mod identifier;