We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4bdb1e commit e3d9d53Copy full SHA for e3d9d53
examples/file_dialog/src/file_picker.rs
@@ -1,5 +1,6 @@
1
+use eframe::egui::mutex::Mutex;
2
use std::path::PathBuf;
-use std::sync::{Arc, Mutex};
3
+use std::sync::Arc;
4
5
/// A file picker
6
/// * prevents multiple concurrent pick operations
@@ -33,7 +34,7 @@ impl Picker {
33
34
std::thread::Builder::new()
35
.name("picker".to_owned())
36
.spawn(move || {
- let mut guard = picker.lock().unwrap();
37
+ let mut guard = picker.lock();
38
*guard = (
39
true,
40
rfd::FileDialog::new()
@@ -53,7 +54,7 @@ impl Picker {
53
54
55
let return_value = match &mut self.state {
56
PickerState::Picking(arc) => {
- if let Ok(mut guard) = arc.try_lock() {
57
+ if let Some(mut guard) = arc.try_lock() {
58
match &mut *guard {
59
(true, picked) => {
60
was_picked = true;
0 commit comments