We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec72386 commit 1e9c03fCopy full SHA for 1e9c03f
1 file changed
examples/async.rs
@@ -1,10 +1,22 @@
1
fn main() {
2
// Spawn dialog on main thread
3
- let task = rfd::AsyncFileDialog::new().pick_file();
+ let task1 = rfd::AsyncFileDialog::new().pick_file();
4
+ let task2 = rfd::AsyncFileDialog::new().pick_file();
5
6
// Await somewhere else
7
execute(async {
- let file = task.await;
8
+ let file = task1.await;
9
+
10
+ if let Some(file) = file {
11
+ // If you are on native platform you can just get the path
12
+ #[cfg(not(target_arch = "wasm32"))]
13
+ println!("{:?}", file.path());
14
15
+ // If you care about wasm support you just read() the file
16
+ file.read().await;
17
+ }
18
19
+ let file = task2.await;
20
21
if let Some(file) = file {
22
// If you are on native platform you can just get the path
0 commit comments