diff --git a/bench/tests/Cargo.toml b/bench/tests/Cargo.toml index b7c345b6d..01ea71dfd 100644 --- a/bench/tests/Cargo.toml +++ b/bench/tests/Cargo.toml @@ -9,6 +9,7 @@ edition = "2018" [dependencies] wry = { path = "../../" } serde = { version = "1.0", features = [ "derive" ] } +tao = { git = "https://github.com/tauri-apps/tao", default-features = false, features = ["rwh_05"] } [[bin]] name = "bench_hello_world" diff --git a/bench/tests/src/cpu_intensive.rs b/bench/tests/src/cpu_intensive.rs index 4a71f8302..c6491fe56 100644 --- a/bench/tests/src/cpu_intensive.rs +++ b/bench/tests/src/cpu_intensive.rs @@ -5,26 +5,25 @@ use std::process::exit; fn main() -> wry::Result<()> { + use tao::{ + event::{Event, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + window::WindowBuilder, + }; use wry::{ - application::{ - event::{Event, WindowEvent}, - event_loop::{ControlFlow, EventLoop}, - window::{Window, WindowBuilder}, - }, http::{header::CONTENT_TYPE, Response}, - webview::WebViewBuilder, + WebViewBuilder, }; let event_loop = EventLoop::new(); let window = WindowBuilder::new().build(&event_loop).unwrap(); - let handler = |_window: &Window, req: String| { + let handler = |req: String| { if &req == "process-complete" { exit(0); } }; - let _webview = WebViewBuilder::new(window) - .unwrap() + let _webview = WebViewBuilder::new(&window) .with_custom_protocol("wrybench".into(), move |request| { let path = request.uri().to_string(); let requested_asset_path = path.strip_prefix("wrybench://localhost").unwrap(); diff --git a/bench/tests/src/custom_protocol.rs b/bench/tests/src/custom_protocol.rs index 1739d2db6..9c57213c5 100644 --- a/bench/tests/src/custom_protocol.rs +++ b/bench/tests/src/custom_protocol.rs @@ -29,26 +29,25 @@ struct MessageParameters { } fn main() -> wry::Result<()> { + use tao::{ + event::{Event, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + window::WindowBuilder, + }; use wry::{ - application::{ - event::{Event, WindowEvent}, - event_loop::{ControlFlow, EventLoop}, - window::{Window, WindowBuilder}, - }, http::{header::CONTENT_TYPE, Response}, - webview::WebViewBuilder, + WebViewBuilder, }; let event_loop = EventLoop::new(); let window = WindowBuilder::new().build(&event_loop).unwrap(); - let handler = |_window: &Window, req: String| { + let handler = |req: String| { if &req == "dom-loaded" { exit(0); } }; - let _webview = WebViewBuilder::new(window) - .unwrap() + let _webview = WebViewBuilder::new(&window) .with_ipc_handler(handler) .with_custom_protocol("wrybench".into(), move |_request| { Response::builder() @@ -69,5 +68,5 @@ fn main() -> wry::Result<()> { } => *control_flow = ControlFlow::Exit, _ => {} } - }); + }) } diff --git a/bench/tests/src/hello_world.rs b/bench/tests/src/hello_world.rs index 0ead7bec8..29e3eef62 100644 --- a/bench/tests/src/hello_world.rs +++ b/bench/tests/src/hello_world.rs @@ -11,14 +11,12 @@ struct MessageParameters { } fn main() -> wry::Result<()> { - use wry::{ - application::{ - event::{Event, WindowEvent}, - event_loop::{ControlFlow, EventLoop}, - window::{Window, WindowBuilder}, - }, - webview::WebViewBuilder, + use tao::{ + event::{Event, WindowEvent}, + event_loop::{ControlFlow, EventLoop}, + window::WindowBuilder, }; + use wry::WebViewBuilder; let event_loop = EventLoop::new(); let window = WindowBuilder::new().build(&event_loop).unwrap(); @@ -31,13 +29,12 @@ fn main() -> wry::Result<()> { "#; - let handler = |_window: &Window, req: String| { + let handler = |req: String| { if &req == "dom-loaded" { exit(0); } }; - let _webview = WebViewBuilder::new(window) - .unwrap() + let _webview = WebViewBuilder::new(&window) .with_url(url)? .with_ipc_handler(handler) .build()?; @@ -52,5 +49,5 @@ fn main() -> wry::Result<()> { } => *control_flow = ControlFlow::Exit, _ => {} } - }); + }) }