Remove the last bits of unknown_os in the code base (#9718)

* Remove the last bits of unknown_os in the code base

* Fmt
This commit is contained in:
Bastian Köcher
2021-09-09 11:17:16 +02:00
committed by GitHub
parent a443944167
commit 129c9ed09e
28 changed files with 197 additions and 523 deletions
@@ -175,7 +175,6 @@ impl<M: Metadata> RequestMiddleware<M> for RpcMiddleware {
F: Fn(jsonrpc_core::Call, M) -> X + Send + Sync,
X: Future<Output = Option<jsonrpc_core::Output>> + Send + 'static,
{
#[cfg(not(target_os = "unknown"))]
let start = std::time::Instant::now();
let name = call_name(&call, &self.known_rpc_method_names).to_owned();
let metrics = self.metrics.clone();
@@ -191,11 +190,7 @@ impl<M: Metadata> RequestMiddleware<M> for RpcMiddleware {
Either::Left(
async move {
let r = r.await;
#[cfg(not(target_os = "unknown"))]
let micros = start.elapsed().as_micros();
// seems that std::time is not implemented for browser target
#[cfg(target_os = "unknown")]
let micros = 1;
if let Some(ref metrics) = metrics {
metrics
.calls_time