aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/lib.rs
diff options
context:
space:
mode:
authorGeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com>2023-03-23 00:07:38 +0100
committerGitHub <noreply@github.com>2023-03-22 23:07:38 +0000
commitc18ea937b568df72e48696daaec321bd0d6fda66 (patch)
treeebaf51c8a679cd89efb11cba610d21277e907a2f /src-tauri/src/lib.rs
parent7f25d130c1e4ec8f57d91f87cb5420696e9ed774 (diff)
downloadFlightCore-c18ea937b568df72e48696daaec321bd0d6fda66.tar.gz
FlightCore-c18ea937b568df72e48696daaec321bd0d6fda66.zip
fix: Address clippy warnings regarding format!() (#229)
Use the varible name directly inside the string
Diffstat (limited to 'src-tauri/src/lib.rs')
-rw-r--r--src-tauri/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 964039eb..0c17caa8 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -52,7 +52,7 @@ pub struct NorthstarServer {
/// Check version number of a mod
pub fn check_mod_version_number(path_to_mod_folder: String) -> Result<String, anyhow::Error> {
// println!("{}", format!("{}/mod.json", path_to_mod_folder));
- let data = std::fs::read_to_string(format!("{}/mod.json", path_to_mod_folder))?;
+ let data = std::fs::read_to_string(format!("{path_to_mod_folder}/mod.json"))?;
let parsed_json: serde_json::Value = serde_json::from_str(&data)?;
// println!("{}", parsed_json);
let mod_version_number = match parsed_json.get("Version").and_then(|value| value.as_str()) {
@@ -128,13 +128,13 @@ pub fn find_game_install_location() -> Result<GameInstall, String> {
/// Checks whether the provided path is a valid Titanfall2 gamepath by checking against a certain set of criteria
pub fn check_is_valid_game_path(game_install_path: &str) -> Result<(), String> {
- let path_to_titanfall2_exe = format!("{}/Titanfall2.exe", game_install_path);
+ let path_to_titanfall2_exe = format!("{game_install_path}/Titanfall2.exe");
let is_correct_game_path = std::path::Path::new(&path_to_titanfall2_exe).exists();
log::info!("Titanfall2.exe exists in path? {}", is_correct_game_path);
// Exit early if wrong game path
if !is_correct_game_path {
- return Err(format!("Incorrect game path \"{}\"", game_install_path)); // Return error cause wrong game path
+ return Err(format!("Incorrect game path \"{game_install_path}\"")); // Return error cause wrong game path
}
Ok(())
}
@@ -191,7 +191,7 @@ async fn do_install(nmod: &thermite::model::ModVersion, game_path: &std::path::P
std::fs::create_dir_all(download_directory.clone())?;
let download_path = format!("{}/{}", download_directory.clone(), filename);
- println!("{}", download_path);
+ println!("{download_path}");
let nfile = thermite::core::manage::download_file(&nmod.url, download_path).unwrap();