summaryrefslogtreecommitdiff
path: root/exes/rest
diff options
context:
space:
mode:
authorMatthieuCoder <matthieu@matthieu-dev.xyz>2023-01-13 22:35:46 +0400
committerMatthieuCoder <matthieu@matthieu-dev.xyz>2023-01-13 22:35:46 +0400
commit4b55d5ff172f87bfa38ef2a21aceed40aacf9c54 (patch)
tree2e2dfe5290de4036299c786d851967bc23de548f /exes/rest
parentb1e17001e3fce2874e4bb1354196c90a5fd7acd0 (diff)
fix build and code cleanup
Diffstat (limited to 'exes/rest')
-rw-r--r--exes/rest/src/lib.rs2
-rw-r--r--exes/rest/src/ratelimit_client/mod.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/exes/rest/src/lib.rs b/exes/rest/src/lib.rs
index b2287b4..4ec8b51 100644
--- a/exes/rest/src/lib.rs
+++ b/exes/rest/src/lib.rs
@@ -7,7 +7,7 @@ use hyper::{
Body, Client, Request, Server,
};
use leash::{AnyhowResultFuture, Component};
-use opentelemetry::{global};
+use opentelemetry::global;
use opentelemetry_http::HeaderExtractor;
use shared::config::Settings;
use std::{convert::Infallible, sync::Arc};
diff --git a/exes/rest/src/ratelimit_client/mod.rs b/exes/rest/src/ratelimit_client/mod.rs
index ecd489c..dc3e970 100644
--- a/exes/rest/src/ratelimit_client/mod.rs
+++ b/exes/rest/src/ratelimit_client/mod.rs
@@ -104,7 +104,7 @@ impl RemoteRatelimiter {
.instrument(trace_span!("acquiring ring lock"))
.await
.get(&path)
- .and_then(|node| Some(node.clone()))
+ .cloned()
.ok_or_else(|| {
anyhow!(
"did not compute ratelimit because no ratelimiter nodes are detected"
@@ -142,7 +142,7 @@ impl RemoteRatelimiter {
.instrument(trace_span!("acquiring ring lock"))
.await
.get(&path)
- .and_then(|node| Some(node.clone()))
+ .cloned()
.ok_or_else(|| {
anyhow!("did not compute ratelimit because no ratelimiter nodes are detected")
})?;