Skip to content

Commit

Permalink
Cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Yu-Wei Wu committed Apr 10, 2022
1 parent 35b6b9e commit 6611826
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/webview/android/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{ffi::c_void, ptr::null_mut, rc::Rc, sync::RwLock, collections::HashSet};
use std::{collections::HashSet, ffi::c_void, ptr::null_mut, rc::Rc, sync::RwLock};

use crate::{application::window::Window, Result};

Expand Down Expand Up @@ -71,10 +71,15 @@ impl InnerWebView {

if let Some(u) = url {
let mut url_string = String::from(u.as_str());
let schemes = custom_protocols.into_iter().map(|(s, _)| s).collect::<HashSet<_>>();
let schemes = custom_protocols
.into_iter()
.map(|(s, _)| s)
.collect::<HashSet<_>>();
let name = u.scheme();
if schemes.contains(name) {
url_string = u.as_str().replace(&format!("{}://", name), "https://tauri.wry/")
url_string = u
.as_str()
.replace(&format!("{}://", name), "https://tauri.wry/")
}
let url = env.new_string(url_string)?;
env.call_method(jobject, "loadUrl", "(Ljava/lang/String;)V", &[url.into()])?;
Expand Down

0 comments on commit 6611826

Please sign in to comment.