Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newer clippy lints #398

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading