Skip to content

Commit

Permalink
chore: address clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Feb 19, 2025
1 parent bb18fd8 commit 34ab565
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions graphql/async-graphql/src/star_wars/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct Human<'a>(&'a StarWarsChar);

/// A humanoid creature in the Star Wars universe.
#[Object]
impl<'a> Human<'a> {
impl Human<'_> {
/// The id of the human.
async fn id(&self) -> &str {
self.0.id
Expand Down Expand Up @@ -63,7 +63,7 @@ pub struct Droid<'a>(&'a StarWarsChar);

/// A mechanical creature in the Star Wars universe.
#[Object]
impl<'a> Droid<'a> {
impl Droid<'_> {
/// The id of the droid.
async fn id(&self) -> &str {
self.0.id
Expand Down
4 changes: 2 additions & 2 deletions guards/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod v1 {
ctx.head()
.headers()
.get("Accept-Version")
.map_or(false, |hv| hv.as_bytes() == b"1")
.is_some_and(|hv| hv.as_bytes() == b"1")
}
}

Expand All @@ -37,7 +37,7 @@ mod v2 {
ctx.head()
.headers()
.get("Accept-Version")
.map_or(false, |hv| hv.as_bytes() == b"2")
.is_some_and(|hv| hv.as_bytes() == b"2")
}
}

Expand Down
4 changes: 2 additions & 2 deletions middleware/http-to-https/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ async fn main() -> std::io::Result<()> {
Either::Left(srv.call(sreq).map(|res| res))
} else {
println!("An http request has arrived here, i will redirect it to use https");
return Either::Right(future::ready(Ok(sreq.into_response(
Either::Right(future::ready(Ok(sreq.into_response(
HttpResponse::MovedPermanently()
.append_header((http::header::LOCATION, url))
.finish(),
))));
))))
}
})
.service(index)
Expand Down
2 changes: 1 addition & 1 deletion websockets/chat-tcp/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use rand::{rngs::ThreadRng, Rng};
use crate::session;

/// Message for chat server communications
///
/// New chat session is created
#[derive(Message)]
#[rtype(usize)]
Expand Down
2 changes: 1 addition & 1 deletion websockets/chat/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use rand::{rngs::ThreadRng, Rng};
pub struct Message(pub String);

/// Message for chat server communications
///
/// New chat session is created
#[derive(Message)]
#[rtype(usize)]
Expand Down

0 comments on commit 34ab565

Please sign in to comment.