Skip to content

Commit

Permalink
chore: address clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Jan 8, 2025
1 parent f2bc208 commit 5ec94f5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions actix-hash/tests/body_hash.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(missing_docs)]

use actix_hash::{BodyHash, BodySha256};
use actix_http::BoxedPayloadStream;
use actix_web::{
Expand Down
3 changes: 1 addition & 2 deletions actix-web-lab-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,7 @@ pub fn derive_from_request(input: proc_macro::TokenStream) -> proc_macro::TokenS
.iter()
.filter(|field| {
field.attrs.iter().any(|attr| {
attr.parse_args::<Ident>()
.map_or(false, |ident| ident == "copy_from_app_data")
attr.parse_args::<Ident>().is_ok_and(|ident| ident == "copy_from_app_data")
})
})
.map(|field| {
Expand Down
2 changes: 2 additions & 0 deletions actix-web-lab-derive/tests/tdd.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(missing_docs)]

use actix_web::{
http::{Method, StatusCode},
web, App, HttpResponse, Responder,
Expand Down
2 changes: 2 additions & 0 deletions actix-web-lab-derive/tests/trybuild.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(missing_docs)]

#[rustversion::stable(1.70)] // MSRV
#[test]
fn compile_macros() {
Expand Down
4 changes: 2 additions & 2 deletions actix-web-lab/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ pub fn fork_request_payload(orig_payload: &mut dev::Payload) -> dev::Payload {
/// perform a remaining length check before writing.
pub(crate) struct MutWriter<'a, B>(pub(crate) &'a mut B);

impl<'a, B> MutWriter<'a, B> {
impl<B> MutWriter<'_, B> {
pub fn get_ref(&self) -> &B {
self.0
}
}

impl<'a, B: BufMut> io::Write for MutWriter<'a, B> {
impl<B: BufMut> io::Write for MutWriter<'_, B> {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.0.put_slice(buf);
Ok(buf.len())
Expand Down
1 change: 1 addition & 0 deletions russe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub const MEDIA_TYPE_STR: &str = "text/event-stream";

#[cfg(test)]
mod tests {
/// Asserts that `Option<T>` argument is `None`.
#[macro_export]
macro_rules! assert_none {
($exp:expr) => {{
Expand Down

0 comments on commit 5ec94f5

Please sign in to comment.