Skip to content

Commit 9ad1c1d

Browse files
authored
fix: Apply clippy 1.60 lints (#1220)
1 parent 7d1f750 commit 9ad1c1d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

relay-general/src/store/normalize/request.rs

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ fn normalize_url(request: &mut Request) {
7676
};
7777
}
7878

79+
#[allow(clippy::ptr_arg)] // normalize_method must be &mut String for `apply`.
7980
fn normalize_method(method: &mut String, meta: &mut Meta) -> ProcessingResult {
8081
method.make_ascii_uppercase();
8182

@@ -86,6 +87,7 @@ fn normalize_method(method: &mut String, meta: &mut Meta) -> ProcessingResult {
8687

8788
Ok(())
8889
}
90+
8991
/// Decodes an urlencoded body.
9092
fn urlencoded_from_str(raw: &str) -> Option<Value> {
9193
// Binary strings would be decoded, but we know url-encoded bodies are ASCII.

relay-general/src/store/schema.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ where
8585
}
8686

8787
fn verify_value_characters(
88-
value: &mut String,
88+
value: &mut str,
8989
meta: &mut Meta,
9090
state: &ProcessingState<'_>,
9191
) -> ProcessingResult {

relay-server/src/utils/rate_limits.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ where
365365
let mut enforcement = Enforcement::default();
366366

367367
if let Some(category) = summary.event_category {
368-
let event_limits = (&mut self.check)(scoping.item(category), 1)?;
368+
let event_limits = (self.check)(scoping.item(category), 1)?;
369369
let longest = event_limits.longest();
370370
enforcement.event = CategoryLimit::new(category, 1, longest);
371371

@@ -381,7 +381,7 @@ where
381381

382382
if !enforcement.event.is_active() && summary.attachment_quantity > 0 {
383383
let item_scoping = scoping.item(DataCategory::Attachment);
384-
let attachment_limits = (&mut self.check)(item_scoping, summary.attachment_quantity)?;
384+
let attachment_limits = (self.check)(item_scoping, summary.attachment_quantity)?;
385385
enforcement.attachments = CategoryLimit::new(
386386
DataCategory::Attachment,
387387
summary.attachment_quantity,
@@ -398,7 +398,7 @@ where
398398

399399
if summary.session_quantity > 0 {
400400
let item_scoping = scoping.item(DataCategory::Session);
401-
let session_limits = (&mut self.check)(item_scoping, summary.session_quantity)?;
401+
let session_limits = (self.check)(item_scoping, summary.session_quantity)?;
402402
enforcement.sessions = CategoryLimit::new(
403403
DataCategory::Session,
404404
summary.session_quantity,

0 commit comments

Comments
 (0)