Skip to content

Commit

Permalink
Wasm cleanup (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyMeilex authored Aug 30, 2022
1 parent 26ad941 commit 7a0ab7a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions examples/winit-example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ fn main() {
}
event::Event::WindowEvent { event, .. } => match event {
WindowEvent::CloseRequested { .. } => *control_flow = ControlFlow::Exit,
#[cfg(not(target_arch = "wasm32"))]
WindowEvent::KeyboardInput {
input:
event::KeyboardInput {
Expand Down
1 change: 1 addition & 0 deletions examples/winit-example/wasm-build.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/bin/sh
cargo build --target wasm32-unknown-unknown
wasm-bindgen --out-dir dist --web target/wasm32-unknown-unknown/debug/wasm-example.wasm
2 changes: 0 additions & 2 deletions src/backend/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,6 @@ impl Drop for WasmDialog {
}
}

use std::future::Future;

use super::{AsyncFilePickerDialogImpl, DialogFutureType};

impl AsyncFilePickerDialogImpl for FileDialog {
Expand Down
10 changes: 7 additions & 3 deletions src/file_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use raw_window_handle::{HasRawWindowHandle, RawWindowHandle};

#[derive(Debug, Clone)]
pub(crate) struct Filter {
#[allow(dead_code)]
pub name: String,
pub extensions: Vec<String>,
}
Expand All @@ -30,6 +31,7 @@ unsafe impl Send for FileDialog {}

impl FileDialog {
/// New file dialog builder
#[cfg(not(target_arch = "wasm32"))]
pub fn new() -> Self {
Default::default()
}
Expand Down Expand Up @@ -86,6 +88,7 @@ impl FileDialog {
}
}

#[cfg(not(target_arch = "wasm32"))]
use crate::backend::{FilePickerDialogImpl, FileSaveDialogImpl, FolderPickerDialogImpl};

#[cfg(not(target_arch = "wasm32"))]
Expand Down Expand Up @@ -195,9 +198,10 @@ impl AsyncFileDialog {
}
}

use crate::backend::{
AsyncFilePickerDialogImpl, AsyncFileSaveDialogImpl, AsyncFolderPickerDialogImpl,
};
use crate::backend::AsyncFilePickerDialogImpl;
#[cfg(not(target_arch = "wasm32"))]
use crate::backend::{AsyncFileSaveDialogImpl, AsyncFolderPickerDialogImpl};

use std::future::Future;

impl AsyncFileDialog {
Expand Down

0 comments on commit 7a0ab7a

Please sign in to comment.