Skip to content

Commit

Permalink
allow clippy::mutex_atomic at the project level
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Jul 24, 2019
1 parent 2baee47 commit ae3bd60
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion ci/azure-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
cargo clippy --version
displayName: Install clippy
- script: |
cargo clippy --all --all-features -- -D clippy::all
cargo clippy --all --all-features -- -D warnings -A clippy::mutex-atomic
displayName: cargo clippy --all
5 changes: 0 additions & 5 deletions tokio-test/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ pub struct MockTask {
waker: Arc<ThreadWaker>,
}

#[allow(clippy::mutex_atomic)]
#[derive(Debug)]
struct ThreadWaker {
state: Mutex<usize>,
Expand Down Expand Up @@ -107,7 +106,6 @@ impl Default for MockTask {

impl ThreadWaker {
fn new() -> Self {
#[allow(clippy::mutex_atomic)]
ThreadWaker {
state: Mutex::new(IDLE),
condvar: Condvar::new(),
Expand All @@ -117,13 +115,11 @@ impl ThreadWaker {
/// Clears any previously received wakes, avoiding potential spurrious
/// wake notifications. This should only be called immediately before running the
/// task.
#[allow(clippy::mutex_atomic)]
fn clear(&self) {
*self.state.lock().unwrap() = IDLE;
}

fn is_woken(&self) -> bool {
#[allow(clippy::mutex_atomic)]
match *self.state.lock().unwrap() {
IDLE => false,
WAKE => true,
Expand All @@ -134,7 +130,6 @@ impl ThreadWaker {
fn wake(&self) {
// First, try transitioning from IDLE -> NOTIFY, this does not require a
// lock.
#[allow(clippy::mutex_atomic)]
let mut state = self.state.lock().unwrap();
let prev = *state;

Expand Down

0 comments on commit ae3bd60

Please sign in to comment.