]> Untitled Git - lemmy.git/commitdiff
Fix formatting for latest nightly (#ref 3467)
authorFelix Ableitner <me@nutomic.com>
Mon, 3 Jul 2023 09:45:53 +0000 (11:45 +0200)
committerFelix Ableitner <me@nutomic.com>
Mon, 3 Jul 2023 09:45:53 +0000 (11:45 +0200)
crates/utils/src/rate_limit/rate_limiter.rs

index 12f264faebb8ac28761a1d63dc4d7ac851174a82..cea05bc0804dcc77ae1aca066f24212a00c8dfa1 100644 (file)
@@ -195,7 +195,9 @@ impl RateLimitStorage {
   /// Remove buckets older than the given duration
   pub(super) fn remove_older_than(&mut self, duration: Duration, now: InstantSecs) {
     // Only retain buckets that were last used after `instant`
-    let Some(instant) = now.to_instant().checked_sub(duration) else { return };
+    let Some(instant) = now.to_instant().checked_sub(duration) else {
+      return;
+    };
 
     let is_recently_used = |group: &RateLimitedGroup<_>| {
       group