Skip to content

Commit

Permalink
Merge pull request #398 from Kuadrant/clippy
Browse files Browse the repository at this point in the history
Newer clippy lints
  • Loading branch information
alexsnaps authored Nov 29, 2024
2 parents d17acdb + 0cd6658 commit cb9f572
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions limitador-server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use tracing::level_filters::LevelFilter;
use url::Url;

pub fn redacted_url(url: String) -> String {
return match Url::parse(url.as_str()) {
match Url::parse(url.as_str()) {
Ok(url_object) => {
if url_object.password().is_some() {
let mut owned_url = url_object.clone();
Expand All @@ -34,7 +34,7 @@ pub fn redacted_url(url: String) -> String {
}
}
Err(_) => url.clone(),
};
}
}

#[derive(Debug)]
Expand Down
2 changes: 1 addition & 1 deletion limitador-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ fn guess_cache_size() -> Option<u64> {
}

fn leak<D: Display>(s: D) -> &'static str {
return Box::leak(format!("{}", s).into_boxed_str());
Box::leak(format!("{}", s).into_boxed_str())
}

fn configure_tracing_subscriber(config: &Configuration) {
Expand Down
2 changes: 1 addition & 1 deletion limitador/src/storage/distributed/grpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ enum MessagePermit<'a> {
Server(Permit<'a, Result<Packet, Status>>),
Client(Permit<'a, Packet>),
}
impl<'a> MessagePermit<'a> {
impl MessagePermit<'_> {
fn send(self, message: Result<Message, Status>) -> Result<(), Status> {
match self {
MessagePermit::Server(sender) => {
Expand Down
4 changes: 2 additions & 2 deletions limitador/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ async fn distributed_storage_factory(
let addresses = (0..count)
.map(|i| format!("127.0.0.1:{}", 5200 + i))
.collect::<Vec<String>>();
return (0..count)
(0..count)
.map(|i| {
let node = format!("n{}", i);
let listen_address = addresses.get(i).unwrap().to_owned();
Expand All @@ -97,7 +97,7 @@ async fn distributed_storage_factory(
CrInMemoryStorage::new(node, 10_000, listen_address, peer_urls),
)))
})
.collect::<Vec<TestsLimiter>>();
.collect::<Vec<TestsLimiter>>()
}

macro_rules! test_with_distributed_storage_impls {
Expand Down

0 comments on commit cb9f572

Please sign in to comment.