Skip to content

Commit 045915f

Browse files
committed
run clippy check on beta & address clippy warnings
1 parent 610c66e commit 045915f

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

.github/workflows/ci.yml

+7-16
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ on:
77
- staging
88
- trying
99

10+
env:
11+
RUSTFLAGS: -Dwarnings
12+
1013
jobs:
1114
build_and_test:
1215
name: Build and test
1316
runs-on: ${{ matrix.os }}
14-
env:
15-
RUSTFLAGS: -Dwarnings
1617
strategy:
1718
matrix:
1819
os: [ubuntu-latest, windows-latest, macOS-latest]
@@ -48,8 +49,6 @@ jobs:
4849
check_fmt_and_docs:
4950
name: Checking fmt and docs
5051
runs-on: ubuntu-latest
51-
env:
52-
RUSTFLAGS: -Dwarnings
5352
steps:
5453
- uses: actions/checkout@master
5554

@@ -81,19 +80,11 @@ jobs:
8180
clippy_check:
8281
name: Clippy check
8382
runs-on: ubuntu-latest
84-
# TODO: There is a lot of warnings
85-
# env:
86-
# RUSTFLAGS: -Dwarnings
8783
steps:
8884
- uses: actions/checkout@v1
89-
- id: component
90-
uses: actions-rs/components-nightly@v1
91-
with:
92-
component: clippy
93-
- uses: actions-rs/toolchain@v1
94-
with:
95-
toolchain: ${{ steps.component.outputs.toolchain }}
96-
override: true
97-
- run: rustup component add clippy
85+
- name: Install rust
86+
run: rustup update beta && rustup default beta && rustup
87+
- name: Install clippy
88+
run: rustup component add clippy
9889
- name: clippy
9990
run: cargo clippy --all --features unstable

src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
4444
#![cfg_attr(feature = "docs", feature(doc_cfg))]
4545
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
46+
#![allow(clippy::mutex_atomic, clippy::module_inception)]
4647
#![doc(test(attr(deny(rust_2018_idioms, warnings))))]
4748
#![doc(test(attr(allow(unused_extern_crates, unused_variables))))]
4849
#![doc(html_logo_url = "https://async.rs/images/logo--hero.svg")]

src/stream/exact_size_stream.rs

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ pub use crate::stream::Stream;
7575
/// assert_eq!(5, counter.len());
7676
/// # });
7777
/// ```
78+
#[allow(clippy::len_without_is_empty)] // ExactSizeIterator::is_empty is unstable
7879
#[cfg(feature = "unstable")]
7980
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
8081
pub trait ExactSizeStream: Stream {

src/task/task.rs

+2
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ impl Tag {
167167
}
168168

169169
pub fn task(&self) -> &Task {
170+
#[allow(clippy::transmute_ptr_to_ptr)]
170171
unsafe {
171172
let raw = self.raw_metadata.load(Ordering::Acquire);
172173

@@ -189,6 +190,7 @@ impl Tag {
189190
}
190191
}
191192

193+
#[allow(clippy::transmute_ptr_to_ptr)]
192194
mem::transmute::<&AtomicUsize, &Option<Task>>(&self.raw_metadata)
193195
.as_ref()
194196
.unwrap()

0 commit comments

Comments
 (0)