Skip to content

Commit

Permalink
Remove unnecessary string allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
alpeb committed Nov 13, 2024
1 parent 6fc6d75 commit 952c662
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion linkerd/app/inbound/src/metrics/authz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct TcpInner {
pub struct HTTPLocalRateLimitLabels {
pub server: ServerLabel,
pub rate_limit: Option<Arc<Meta>>,
pub scope: String,
pub scope: &'static str,
}

#[derive(Debug, Hash, PartialEq, Eq)]
Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/inbound/src/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ impl AllowPolicy {
use RateLimitError::*;

let scope = match error {
Total(_) => "total".to_string(),
PerIdentity(_) | Override(_) => "identity".to_string(),
Total(_) => "total",
PerIdentity(_) | Override(_) => "identity",
};
HTTPLocalRateLimitLabels {
server: self.server_label(),
Expand Down

0 comments on commit 952c662

Please sign in to comment.