Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Amr Bashir <amr.bashir2015@gmail.com>
  • Loading branch information
JensMertelmeyer and amrbashir committed Apr 26, 2022
1 parent 3a56f1c commit 784e276
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/webview/webview2/mod.rs
Expand Up @@ -94,19 +94,14 @@ impl InnerWebView {

CreateCoreWebView2EnvironmentCompletedHandler::wait_for_async_operation(
Box::new(move |environmentcreatedhandler| unsafe {
let options: ICoreWebView2EnvironmentOptions;
options = CoreWebView2EnvironmentOptions::default().into();
let options: ICoreWebView2EnvironmentOptions = CoreWebView2EnvironmentOptions::default().into();

// remove "mini menu" - See https://github.com/tauri-apps/wry/issues/535
let additional_arguments = pwstr_from_str("--disable-features=msWebOOUI,msPdfOOUI");
let _ = options.SetAdditionalBrowserArguments(additional_arguments);

// if data_directory is None, we set it to a null PWSTR
let data_directory: PWSTR =
match data_directory {
Some(s) => pwstr_from_str(&s),
None => PWSTR::default(),
};
let data_directory: PWSTR = data_directory.map(|s| pwstr_from_str(&s)).unwrap_or_default();

let result = CreateCoreWebView2EnvironmentWithOptions(
PWSTR::default(),
Expand Down

0 comments on commit 784e276

Please sign in to comment.