fixing little tidbits

This commit is contained in:
Chris Cochrun 2023-09-21 12:11:38 -05:00
parent b0b7926f95
commit f26b6fb66a

View file

@ -54,18 +54,18 @@ mod file_helper {
#[qinvokable] #[qinvokable]
pub fn validate(self: Pin<&mut Self>, file: QUrl) -> bool { pub fn validate(self: Pin<&mut Self>, file: QUrl) -> bool {
let file_string = file.to_string(); let file_string = file.to_string();
let _file_string = file_string.strip_prefix("file://"); let file_string = file_string.strip_prefix("file://");
match _file_string { match file_string {
None => {
let _exists =
Path::new(&file.to_string()).exists();
println!("{file} exists? {_exists}");
_exists
}
Some(file) => { Some(file) => {
let _exists = Path::new(&file).exists(); let exists = Path::new(&file).exists();
println!("{file} exists? {_exists}"); println!("{file} exists? {exists}");
_exists exists
}
None => {
let exists =
Path::new(&file.to_string()).exists();
println!("{file} exists? {exists}");
exists
} }
} }
} }