Skip to content

Commit

Permalink
chore: `#![deny(rust_2018_idioms, clippy::disallowed_methods, clippy:…
Browse files Browse the repository at this point in the history
…:disallowed_types)]` (#144)
  • Loading branch information
CherishCai authored Apr 19, 2023
1 parent 2050852 commit 8ce3c5d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type-complexity-threshold = 500
disallowed-methods = [
# Mutating environment variables in a multi-threaded context can cause data races.
# see https://github.com/rust-lang/rust/issues/90308 for details.
"std::env::set_var",
"std::env::remove_var",

# Use tokio::time::sleep instead.
"std::time::sleep",
]
disallowed-types = [
# Use tokio::time::Instant instead.
"std::time::Instant",
]
2 changes: 1 addition & 1 deletion src/api/plugin/auth/auth_by_http.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rand::Rng;
use std::ops::{Add, Deref};
use std::sync::RwLock;
use std::time::{Duration, Instant};
use tokio::time::{Duration, Instant};

use crate::api::plugin::{AuthContext, AuthPlugin, LoginIdentityContext};

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// limitations under the License.
//

#![deny(rust_2018_idioms, clippy::disallowed_methods, clippy::disallowed_types)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, allow(unused_attributes))]

Expand Down

0 comments on commit 8ce3c5d

Please sign in to comment.