mirror of
https://github.com/actix/actix-web.git
synced 2024-12-29 11:30:41 +00:00
Use old clippy attributes syntax (#562)
This commit is contained in:
parent
cfd9a56ff7
commit
3b536ee96c
11 changed files with 14 additions and 14 deletions
|
@ -287,7 +287,7 @@ impl Default for ClientConnector {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg_attr(feature = "cargo-clippy", allow(clippy::let_unit_value))]
|
#[cfg_attr(feature = "cargo-clippy", allow(let_unit_value))]
|
||||||
ClientConnector::with_connector_impl(connector)
|
ClientConnector::with_connector_impl(connector)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(clippy::redundant_field_names)
|
allow(redundant_field_names)
|
||||||
)]
|
)]
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
|
|
@ -694,7 +694,7 @@ impl HttpResponseBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
#[cfg_attr(feature = "cargo-clippy", allow(clippy::borrowed_box))]
|
#[cfg_attr(feature = "cargo-clippy", allow(borrowed_box))]
|
||||||
fn parts<'a>(
|
fn parts<'a>(
|
||||||
parts: &'a mut Option<Box<InnerHttpResponse>>, err: &Option<HttpError>,
|
parts: &'a mut Option<Box<InnerHttpResponse>>, err: &Option<HttpError>,
|
||||||
) -> Option<&'a mut Box<InnerHttpResponse>> {
|
) -> Option<&'a mut Box<InnerHttpResponse>> {
|
||||||
|
|
|
@ -18,7 +18,7 @@ impl ConnectionInfo {
|
||||||
/// Create *ConnectionInfo* instance for a request.
|
/// Create *ConnectionInfo* instance for a request.
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(clippy::cyclomatic_complexity)
|
allow(cyclomatic_complexity)
|
||||||
)]
|
)]
|
||||||
pub fn update(&mut self, req: &Request) {
|
pub fn update(&mut self, req: &Request) {
|
||||||
let mut host = None;
|
let mut host = None;
|
||||||
|
|
|
@ -48,7 +48,7 @@ impl DefaultHeaders {
|
||||||
|
|
||||||
/// Set a header.
|
/// Set a header.
|
||||||
#[inline]
|
#[inline]
|
||||||
#[cfg_attr(feature = "cargo-clippy", allow(clippy::match_wild_err_arm))]
|
#[cfg_attr(feature = "cargo-clippy", allow(match_wild_err_arm))]
|
||||||
pub fn header<K, V>(mut self, key: K, value: V) -> Self
|
pub fn header<K, V>(mut self, key: K, value: V) -> Self
|
||||||
where
|
where
|
||||||
HeaderName: HttpTryFrom<K>,
|
HeaderName: HttpTryFrom<K>,
|
||||||
|
|
|
@ -61,7 +61,7 @@ pub struct Scope<S> {
|
||||||
|
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(clippy::new_without_default_derive)
|
allow(new_without_default_derive)
|
||||||
)]
|
)]
|
||||||
impl<S: 'static> Scope<S> {
|
impl<S: 'static> Scope<S> {
|
||||||
/// Create a new scope
|
/// Create a new scope
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#![cfg_attr(
|
#![cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(clippy::redundant_field_names)
|
allow(redundant_field_names)
|
||||||
)]
|
)]
|
||||||
|
|
||||||
use std::{cmp, io};
|
use std::{cmp, io};
|
||||||
|
|
|
@ -326,7 +326,7 @@ where
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(clippy::needless_pass_by_value)
|
allow(needless_pass_by_value)
|
||||||
)]
|
)]
|
||||||
pub fn bind_with<S, A>(mut self, addr: S, acceptor: A) -> io::Result<Self>
|
pub fn bind_with<S, A>(mut self, addr: S, acceptor: A) -> io::Result<Self>
|
||||||
where
|
where
|
||||||
|
|
|
@ -438,7 +438,7 @@ impl ContentEncoder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "cargo-clippy", allow(clippy::inline_always))]
|
#[cfg_attr(feature = "cargo-clippy", allow(inline_always))]
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn write_eof(&mut self) -> Result<bool, io::Error> {
|
pub fn write_eof(&mut self) -> Result<bool, io::Error> {
|
||||||
let encoder =
|
let encoder =
|
||||||
|
@ -480,7 +480,7 @@ impl ContentEncoder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "cargo-clippy", allow(clippy::inline_always))]
|
#[cfg_attr(feature = "cargo-clippy", allow(inline_always))]
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn write(&mut self, data: &[u8]) -> Result<(), io::Error> {
|
pub fn write(&mut self, data: &[u8]) -> Result<(), io::Error> {
|
||||||
match *self {
|
match *self {
|
||||||
|
|
|
@ -46,7 +46,7 @@ impl Frame {
|
||||||
Frame::message(payload, OpCode::Close, true, genmask)
|
Frame::message(payload, OpCode::Close, true, genmask)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg_attr(feature = "cargo-clippy", allow(clippy::type_complexity))]
|
#[cfg_attr(feature = "cargo-clippy", allow(type_complexity))]
|
||||||
fn read_copy_md<S>(
|
fn read_copy_md<S>(
|
||||||
pl: &mut PayloadBuffer<S>, server: bool, max_size: usize,
|
pl: &mut PayloadBuffer<S>, server: bool, max_size: usize,
|
||||||
) -> Poll<Option<(usize, bool, OpCode, usize, Option<u32>)>, ProtocolError>
|
) -> Poll<Option<(usize, bool, OpCode, usize, Option<u32>)>, ProtocolError>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
//! This is code from [Tungstenite project](https://github.com/snapview/tungstenite-rs)
|
//! This is code from [Tungstenite project](https://github.com/snapview/tungstenite-rs)
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
|
#![cfg_attr(feature = "cargo-clippy", allow(cast_ptr_alignment))]
|
||||||
use std::ptr::copy_nonoverlapping;
|
use std::ptr::copy_nonoverlapping;
|
||||||
use std::slice;
|
use std::slice;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ impl<'a> ShortSlice<'a> {
|
||||||
|
|
||||||
/// Faster version of `apply_mask()` which operates on 8-byte blocks.
|
/// Faster version of `apply_mask()` which operates on 8-byte blocks.
|
||||||
#[inline]
|
#[inline]
|
||||||
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_lossless))]
|
#[cfg_attr(feature = "cargo-clippy", allow(cast_lossless))]
|
||||||
pub(crate) fn apply_mask(buf: &mut [u8], mask_u32: u32) {
|
pub(crate) fn apply_mask(buf: &mut [u8], mask_u32: u32) {
|
||||||
// Extend the mask to 64 bits
|
// Extend the mask to 64 bits
|
||||||
let mut mask_u64 = ((mask_u32 as u64) << 32) | (mask_u32 as u64);
|
let mut mask_u64 = ((mask_u32 as u64) << 32) | (mask_u32 as u64);
|
||||||
|
@ -52,7 +52,7 @@ pub(crate) fn apply_mask(buf: &mut [u8], mask_u32: u32) {
|
||||||
// a `ShortSlice` must be smaller than a u64.
|
// a `ShortSlice` must be smaller than a u64.
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
feature = "cargo-clippy",
|
feature = "cargo-clippy",
|
||||||
allow(clippy::needless_pass_by_value)
|
allow(needless_pass_by_value)
|
||||||
)]
|
)]
|
||||||
fn xor_short(buf: ShortSlice, mask: u64) {
|
fn xor_short(buf: ShortSlice, mask: u64) {
|
||||||
// Unsafe: we know that a `ShortSlice` fits in a u64
|
// Unsafe: we know that a `ShortSlice` fits in a u64
|
||||||
|
|
Loading…
Reference in a new issue