Skip to content

Commit

Permalink
select_vpk handler doesn't need to be a result
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabwhy committed Mar 1, 2024
1 parent 21a253f commit 7cb8869
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,15 @@ impl ExtractState {
}

#[tauri::command]
async fn select_vpk(window: Window) -> Result<Option<String>, String> {
async fn select_vpk(window: Window) -> Option<String> {
let file = AsyncFileDialog::new()
.set_parent(&window)
.set_title("Select a VPK file")
.add_filter("VPK Files", &["vpk"])
.pick_file()
.await;

match file {
Some(vpk_file) => {
Ok(Some(vpk_file.path().to_str().ok_or("Invalid path")?.to_string()))
}
None => Ok(None),
}
Some(file?.path().to_str()?.to_string())
}

#[tauri::command]
Expand Down

0 comments on commit 7cb8869

Please sign in to comment.