more cleanup
This commit is contained in:
parent
48ab34f577
commit
7da6b62c52
@ -189,9 +189,9 @@ impl RPCProcessor {
|
|||||||
.to_rpc_network_result()?);
|
.to_rpc_network_result()?);
|
||||||
|
|
||||||
// Get the assembled route for response
|
// Get the assembled route for response
|
||||||
let private_route = rss
|
let private_route = network_result_try!(rss
|
||||||
.assemble_private_route(&pr_key, None)
|
.assemble_private_route(&pr_key, None)
|
||||||
.map_err(RPCError::internal)?;
|
.to_rpc_network_result()?);
|
||||||
|
|
||||||
Ok(NetworkResult::Value(RespondTo::PrivateRoute(private_route)))
|
Ok(NetworkResult::Value(RespondTo::PrivateRoute(private_route)))
|
||||||
}
|
}
|
||||||
@ -216,9 +216,9 @@ impl RPCProcessor {
|
|||||||
.to_rpc_network_result()?);
|
.to_rpc_network_result()?);
|
||||||
|
|
||||||
// Get the assembled route for response
|
// Get the assembled route for response
|
||||||
let private_route = rss
|
let private_route = network_result_try!(rss
|
||||||
.assemble_private_route(&pr_key, None)
|
.assemble_private_route(&pr_key, None)
|
||||||
.map_err(RPCError::internal)?;
|
.to_rpc_network_result()?);
|
||||||
|
|
||||||
Ok(NetworkResult::Value(RespondTo::PrivateRoute(private_route)))
|
Ok(NetworkResult::Value(RespondTo::PrivateRoute(private_route)))
|
||||||
}
|
}
|
||||||
@ -282,9 +282,9 @@ impl RPCProcessor {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Get the assembled route for response
|
// Get the assembled route for response
|
||||||
let private_route = rss
|
let private_route = network_result_try!(rss
|
||||||
.assemble_private_route(&pr_key, None)
|
.assemble_private_route(&pr_key, None)
|
||||||
.map_err(RPCError::internal)?;
|
.to_rpc_network_result()?);
|
||||||
|
|
||||||
Ok(NetworkResult::Value(RespondTo::PrivateRoute(private_route)))
|
Ok(NetworkResult::Value(RespondTo::PrivateRoute(private_route)))
|
||||||
}
|
}
|
||||||
|
@ -403,7 +403,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "0.2.3"
|
version: "0.2.4"
|
||||||
web:
|
web:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
@ -18,21 +18,21 @@ extern "C" {
|
|||||||
|
|
||||||
pub fn is_browser() -> bool {
|
pub fn is_browser() -> bool {
|
||||||
static CACHE: AtomicI8 = AtomicI8::new(-1);
|
static CACHE: AtomicI8 = AtomicI8::new(-1);
|
||||||
let cache = CACHE.load(Ordering::AcqRel);
|
let cache = CACHE.load(Ordering::Acquire);
|
||||||
if cache != -1 {
|
if cache != -1 {
|
||||||
return cache != 0;
|
return cache != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
let res = Reflect::has(global().as_ref(), &"navigator".into()).unwrap_or_default();
|
let res = Reflect::has(global().as_ref(), &"navigator".into()).unwrap_or_default();
|
||||||
|
|
||||||
CACHE.store(res as i8, Ordering::AcqRel);
|
CACHE.store(res as i8, Ordering::Release);
|
||||||
|
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_browser_https() -> bool {
|
pub fn is_browser_https() -> bool {
|
||||||
static CACHE: AtomicI8 = AtomicI8::new(-1);
|
static CACHE: AtomicI8 = AtomicI8::new(-1);
|
||||||
let cache = CACHE.load(Ordering::AcqRel);
|
let cache = CACHE.load(Ordering::Acquire);
|
||||||
if cache != -1 {
|
if cache != -1 {
|
||||||
return cache != 0;
|
return cache != 0;
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ pub fn is_browser_https() -> bool {
|
|||||||
.map(|res| res.is_truthy())
|
.map(|res| res.is_truthy())
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
CACHE.store(res as i8, Ordering::AcqRel);
|
CACHE.store(res as i8, Ordering::Release);
|
||||||
|
|
||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user