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

standardise compiler lints across all crates #226

Merged
merged 1 commit into from
Dec 12, 2020
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: 3 additions & 1 deletion actix-codec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
//! [`Sink`]: futures_sink::Sink
//! [`Stream`]: futures_core::Stream

#![deny(rust_2018_idioms)]
#![deny(rust_2018_idioms, nonstandard_style)]
#![warn(missing_docs)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

mod bcodec;
mod framed;
Expand Down
4 changes: 3 additions & 1 deletion actix-connect/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
//! * `openssl` - enables TLS support via `openssl` crate
//! * `rustls` - enables TLS support via `rustls` crate

#![deny(rust_2018_idioms)]
#![deny(rust_2018_idioms, nonstandard_style)]
#![recursion_limit = "128"]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

#[macro_use]
extern crate log;
Expand Down
5 changes: 4 additions & 1 deletion actix-macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Macros for use with Tokio
extern crate proc_macro;

#![deny(rust_2018_idioms, nonstandard_style)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

use proc_macro::TokenStream;
use quote::quote;
Expand Down
4 changes: 3 additions & 1 deletion actix-rt/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! A runtime implementation that runs everything on the current thread.
#![deny(rust_2018_idioms, warnings)]
#![deny(rust_2018_idioms, nonstandard_style)]
#![allow(clippy::type_complexity)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

#[cfg(not(test))] // Work around for rust-lang/rust#62127
pub use actix_macros::{main, test};
Expand Down
4 changes: 3 additions & 1 deletion actix-server/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! General purpose TCP server.

#![deny(rust_2018_idioms)]
#![deny(rust_2018_idioms, nonstandard_style)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

mod accept;
mod builder;
Expand Down
4 changes: 3 additions & 1 deletion actix-service/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
//! See [`Service`](trait.Service.html) docs for information on this crate's foundational trait.

#![deny(rust_2018_idioms, warnings)]
#![deny(rust_2018_idioms, nonstandard_style)]
#![allow(clippy::type_complexity)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

use std::cell::RefCell;
use std::future::Future;
Expand Down
5 changes: 4 additions & 1 deletion actix-testing/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
//! Various helpers for Actix applications to use during testing.
#![deny(rust_2018_idioms, warnings)]

#![deny(rust_2018_idioms, nonstandard_style)]
#![allow(clippy::type_complexity, clippy::needless_doctest_main)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

use std::sync::mpsc;
use std::{net, thread};
Expand Down
4 changes: 4 additions & 0 deletions actix-threadpool/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//! Thread pool for blocking operations

#![deny(rust_2018_idioms, nonstandard_style)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

use std::fmt;
use std::future::Future;
use std::pin::Pin;
Expand Down
4 changes: 3 additions & 1 deletion actix-tls/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
//! * `rustls` - TLS acceptor using the `rustls` crate.
//! * `nativetls` - TLS acceptor using the `native-tls` crate.

#![deny(rust_2018_idioms)]
#![deny(rust_2018_idioms, nonstandard_style)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

use std::sync::atomic::{AtomicUsize, Ordering};

Expand Down
5 changes: 4 additions & 1 deletion actix-tracing/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Actix tracing - support for tokio tracing with Actix services.
#![deny(rust_2018_idioms, warnings)]

#![deny(rust_2018_idioms, nonstandard_style)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

use std::marker::PhantomData;
use std::task::{Context, Poll};
Expand Down
4 changes: 3 additions & 1 deletion actix-utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
//! Actix utils - various helper services

#![deny(rust_2018_idioms)]
#![deny(rust_2018_idioms, nonstandard_style)]
#![allow(clippy::type_complexity)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

pub mod condition;
pub mod counter;
Expand Down
2 changes: 1 addition & 1 deletion router/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ macro_rules! parse_single_value {
};
}

pub struct PathDeserializer<'de, T: ResourcePath + 'de> {
pub struct PathDeserializer<'de, T: ResourcePath> {
path: &'de Path<T>,
}

Expand Down
4 changes: 4 additions & 0 deletions router/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//! Resource path matching library.

#![deny(rust_2018_idioms, nonstandard_style)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

mod de;
mod path;
mod resource;
Expand Down
2 changes: 1 addition & 1 deletion router/src/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ impl<T: ResourcePath> Path<T> {
}

/// Return iterator to items in parameter container
pub fn iter(&self) -> PathIter<T> {
pub fn iter(&self) -> PathIter<'_, T> {
PathIter {
idx: 0,
params: self,
Expand Down
8 changes: 6 additions & 2 deletions string/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//! A UTF-8 encoded read-only string using Bytes as storage.

#![deny(rust_2018_idioms, nonstandard_style)]
#![doc(html_logo_url = "https://actix.rs/img/logo.png")]
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]

use std::convert::TryFrom;
use std::{borrow, fmt, hash, ops, str};

Expand Down Expand Up @@ -156,13 +160,13 @@ macro_rules! array_impls {
array_impls!(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16);

impl fmt::Debug for ByteString {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
(**self).fmt(fmt)
}
}

impl fmt::Display for ByteString {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
(**self).fmt(fmt)
}
}
Expand Down