Skip to content

Commit

Permalink
Fix clippy::used_underscore_items warning
Browse files Browse the repository at this point in the history
```
error: used underscore-prefixed item
   --> tests/stream.rs:144:11
    |
144 |     yield foo::_Foo(0);
    |           ^^^^^^^^^^^^
    |
note: item is defined here
   --> tests/stream.rs:139:5
    |
139 |     pub struct _Foo(pub i32);
    |     ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items
    = note: `-D clippy::used-underscore-items` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::used_underscore_items)]`

error: used underscore-prefixed item
   --> tests/stream.rs:145:11
    |
145 |     yield foo::_Foo(1);
    |           ^^^^^^^^^^^^
    |
note: item is defined here
   --> tests/stream.rs:139:5
    |
139 |     pub struct _Foo(pub i32);
    |     ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items

error: used underscore-prefixed item
   --> tests/stream.rs:158:11
    |
158 |     yield foo::_Foo(0);
    |           ^^^^^^^^^^^^
    |
note: item is defined here
   --> tests/stream.rs:139:5
    |
139 |     pub struct _Foo(pub i32);
    |     ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items

error: used underscore-prefixed item
   --> tests/stream.rs:159:11
    |
159 |     yield foo::_Foo(1);
    |           ^^^^^^^^^^^^
    |
note: item is defined here
   --> tests/stream.rs:139:5
    |
139 |     pub struct _Foo(pub i32);
    |     ^^^^^^^^^^^^^^^
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items
```
  • Loading branch information
taiki-e committed Sep 26, 2024
1 parent 520018f commit 93fd894
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,33 +136,33 @@ async fn stream3() {
}

mod foo {
pub struct _Foo(pub i32);
pub struct Foo(pub i32);
}

#[stream(boxed, item = foo::_Foo)]
#[stream(boxed, item = foo::Foo)]
pub async fn stream5() {
yield foo::_Foo(0);
yield foo::_Foo(1);
yield foo::Foo(0);
yield foo::Foo(1);
}

#[stream(item = i32, boxed)]
pub async fn stream6() {
#[for_await]
for foo::_Foo(i) in stream5() {
for foo::Foo(i) in stream5() {
yield i * i;
}
}

#[stream(boxed_local, item = foo::_Foo)]
#[stream(boxed_local, item = foo::Foo)]
pub async fn stream7() {
yield foo::_Foo(0);
yield foo::_Foo(1);
yield foo::Foo(0);
yield foo::Foo(1);
}

#[stream(item = i32, boxed_local)]
pub async fn stream8() {
#[for_await]
for foo::_Foo(i) in stream5() {
for foo::Foo(i) in stream5() {
yield i * i;
}
}
Expand Down

0 comments on commit 93fd894

Please sign in to comment.