From f26b6fb66a986ec5270c61fde787c48e0aeea6e4 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Thu, 21 Sep 2023 12:11:38 -0500 Subject: [PATCH] fixing little tidbits --- src/rust/file_helper.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/rust/file_helper.rs b/src/rust/file_helper.rs index d1ab84d..b278511 100644 --- a/src/rust/file_helper.rs +++ b/src/rust/file_helper.rs @@ -54,18 +54,18 @@ mod file_helper { #[qinvokable] pub fn validate(self: Pin<&mut Self>, file: QUrl) -> bool { let file_string = file.to_string(); - let _file_string = file_string.strip_prefix("file://"); - match _file_string { - None => { - let _exists = - Path::new(&file.to_string()).exists(); - println!("{file} exists? {_exists}"); - _exists - } + let file_string = file_string.strip_prefix("file://"); + match file_string { Some(file) => { - let _exists = Path::new(&file).exists(); - println!("{file} exists? {_exists}"); - _exists + let exists = Path::new(&file).exists(); + println!("{file} exists? {exists}"); + exists + } + None => { + let exists = + Path::new(&file.to_string()).exists(); + println!("{file} exists? {exists}"); + exists } } }