follow clippy recommendations

This commit is contained in:
Mystikfluu 2023-04-01 16:29:38 +02:00
parent 490dff20fd
commit 036c633bdb

View File

@ -14,7 +14,7 @@ extern crate open;
#[tauri::command] #[tauri::command]
fn get_version() -> String { fn get_version() -> String {
return option_env!("CARGO_PKG_VERSION").unwrap_or("x.x.x").to_string(); option_env!("CARGO_PKG_VERSION").unwrap_or("x.x.x").to_string()
} }
#[tauri::command] #[tauri::command]
@ -31,10 +31,10 @@ fn random_password() -> String {
fn get_entry(name: String, mpw: String) -> Result<(String,String),String> { fn get_entry(name: String, mpw: String) -> Result<(String,String),String> {
let binding = ip_lib::get_entry(&name, mpw); let binding = ip_lib::get_entry(&name, mpw);
if let Ok(data) = binding { if let Ok(data) = binding {
let mut split = data.split(";"); let mut split = data.split(';');
return Ok((split.next().unwrap().to_string(),split.next().unwrap().to_string())); Ok((split.next().unwrap().to_string(),split.next().unwrap().to_string()))
} else { } else {
return Err(binding.expect_err("expected error")); Err(binding.expect_err("expected error"))
} }
} }
@ -51,7 +51,7 @@ fn get_entries() -> Vec<String> {
vector.sort(); vector.sort();
return vector; vector
} }
#[tauri::command] #[tauri::command]
@ -61,14 +61,14 @@ fn remove_entry(name: &str) -> bool {
std::fs::remove_file(filepath).unwrap(); std::fs::remove_file(filepath).unwrap();
return true; return true;
} }
return false; false
} }
#[tauri::command] #[tauri::command]
fn open_authorize() -> u32 { fn open_authorize() -> u32 {
let code:u32 = rand::random(); let code:u32 = rand::random();
open::that(format!("https://ipost.rocks/authorize?id=1&extra={}",code)).unwrap(); open::that(format!("https://ipost.rocks/authorize?id=1&extra={}",code)).unwrap();
return code; code
} }
#[tauri::command] #[tauri::command]