expose #292
clippy
48 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 48 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.74.0-nightly (59a829484 2023-08-30)
- cargo 1.74.0-nightly (96fe1c9e1 2023-08-29)
- clippy 0.1.74 (59a8294 2023-08-30)
Annotations
Check warning on line 311 in src/router.rs
github-actions / clippy
this argument is a mutable reference, but not used mutably
warning: this argument is a mutable reference, but not used mutably
--> src/router.rs:311:17
|
311 | fn settle(link: &mut ReceiverLink, id: DeliveryNumber, state: DeliveryState) {
| ^^^^^^^^^^^^^^^^^ help: consider changing to: `&ReceiverLink`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
Check warning on line 161 in src/rcvlink.rs
github-actions / clippy
this argument is a mutable reference, but not used mutably
warning: this argument is a mutable reference, but not used mutably
--> src/rcvlink.rs:161:13
|
161 | cx: &mut Context<'_>,
| ^^^^^^^^^^^^^^^^ help: consider changing to: `&Context<'_>`
|
= warning: changing this function will impact semver compatibility
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
= note: `#[warn(clippy::needless_pass_by_ref_mut)]` on by default
Check warning on line 501 in src/session.rs
github-actions / clippy
casting to the same type is unnecessary (`u32` -> `u32`)
warning: casting to the same type is unnecessary (`u32` -> `u32`)
--> src/session.rs:501:33
|
501 | handle: id as u32,
| ^^^^^^^^^ help: try: `id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 491 in src/session.rs
github-actions / clippy
casting to the same type is unnecessary (`u32` -> `u32`)
warning: casting to the same type is unnecessary (`u32` -> `u32`)
--> src/session.rs:491:33
|
491 | handle: id as u32,
| ^^^^^^^^^ help: try: `id`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
Check warning on line 241 in src/router.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/router.rs:238:33
|
238 | / ... let _ = this.link.close_with_error(
239 | | ... LinkError::force_detach()
240 | | ... .description("delivery_id MUST be set"),
241 | | ... );
| |________________________^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 229 in src/router.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/router.rs:227:33
|
227 | / ... let _ = this.link.close_with_error(
228 | | ... LinkError::force_detach().description(format!("error: {}", e)),
229 | | ... );
| |________________________^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 380 in src/rcvlink.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/rcvlink.rs:380:21
|
380 | let _ = self.close(Some(err));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 369 in src/rcvlink.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/rcvlink.rs:369:25
|
369 | let _ = self.close(Some(err));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 340 in src/rcvlink.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/rcvlink.rs:340:25
|
340 | let _ = self.close(Some(err));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 327 in src/rcvlink.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/rcvlink.rs:327:25
|
327 | let _ = self.close(Some(err));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 309 in src/rcvlink.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/rcvlink.rs:309:13
|
309 | let _ = self.close(Some(err));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 293 in src/rcvlink.rs
github-actions / clippy
casting to the same type is unnecessary (`u32` -> `u32`)
warning: casting to the same type is unnecessary (`u32` -> `u32`)
--> src/rcvlink.rs:293:28
|
293 | .rcv_link_flow(self.handle as u32, self.delivery_count, credit);
| ^^^^^^^^^^^^^^^^^^ help: try: `self.handle`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
= note: `#[warn(clippy::unnecessary_cast)]` on by default
Check warning on line 417 in src/dispatcher.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/dispatcher.rs:417:13
|
417 | let _ = this.link.close_with_error(e);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 358 in src/dispatcher.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/dispatcher.rs:358:25
|
358 | let _ = self.service.call(types::Message::DetachedAll(receivers));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 344 in src/dispatcher.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/dispatcher.rs:344:25
|
344 | let _ = self.service.call(types::Message::Detached(link));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 234 in src/dispatcher.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/dispatcher.rs:234:13
|
234 | let _ = self.sink.close_with_error(err);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 149 in src/dispatcher.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/dispatcher.rs:149:21
|
149 | let _ = link.close_with_error(err);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 145 in src/dispatcher.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/dispatcher.rs:145:21
|
145 | let _ = link.close_with_error(err);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 142 in src/dispatcher.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/dispatcher.rs:142:21
|
142 | let _ = link.close_with_error(err);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 133 in src/dispatcher.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/dispatcher.rs:133:21
|
133 | let _ = link.close_with_error(err);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
Check warning on line 79 in src/dispatcher.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> src/dispatcher.rs:79:13
|
79 | let _ = self.sink.close_with_error(err);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider awaiting the future or dropping explicitly with `std::mem::drop`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future
= note: `#[warn(clippy::let_underscore_future)]` on by default
Check warning on line 685 in src/session.rs
github-actions / clippy
redundant field names in struct initialization
warning: redundant field names in struct initialization
--> src/session.rs:685:29
|
685 | ... source: source,
| ^^^^^^^^^^^^^^ help: replace it with: `source`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names
= note: `#[warn(clippy::redundant_field_names)]` on by default
Check warning on line 260 in src/dispatcher.rs
github-actions / clippy
this `if` statement can be collapsed
warning: this `if` statement can be collapsed
--> src/dispatcher.rs:240:9
|
240 | / if !self.ctl_queue.pending.borrow().is_empty() {
241 | | if ctl_service_poll.is_ready() {
242 | | while let Some(frame) = self.ctl_queue.pending.borrow_mut().pop_front() {
243 | | let detached_receiver = match frame.kind() {
... |
259 | | }
260 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
240 ~ if !self.ctl_queue.pending.borrow().is_empty() && ctl_service_poll.is_ready() {
241 + while let Some(frame) = self.ctl_queue.pending.borrow_mut().pop_front() {
242 + let detached_receiver = match frame.kind() {
243 + ControlFrameKind::LocalDetachReceiver(_, ref link) => Some(link.clone()),
244 + _ => None,
245 + };
246 + self.call_control_service(frame);
247 +
248 + if let Some(link) = detached_receiver {
249 + self.service.call(types::Message::Detached(link));
250 + }
251 +
252 + ctl_service_poll = self.poll_control_service_readiness(cx)?;
253 + if ctl_service_poll.is_pending() {
254 + break;
255 + }
256 + }
257 + control_fut_pending = true;
258 + }
|
Check warning on line 195 in codec/src/types/mod.rs
github-actions / clippy
deref on an immutable reference
warning: deref on an immutable reference
--> codec/src/types/mod.rs:195:54
|
195 | Str::ByteStr(s) => write!(f, "B:\"{}\"", &*s),
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
help: if you would like to reborrow, try removing `&*`
|
195 | Str::ByteStr(s) => write!(f, "B:\"{}\"", s),
| ~
help: if you would like to deref, try using `&**`
|
195 | Str::ByteStr(s) => write!(f, "B:\"{}\"", &**s),
| ~~~~
Check warning on line 183 in codec/src/types/mod.rs
github-actions / clippy
deref on an immutable reference
warning: deref on an immutable reference
--> codec/src/types/mod.rs:183:31
|
183 | let t: &str = &*s;
| ^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref
help: if you would like to reborrow, try removing `&*`
|
183 | let t: &str = s;
| ~
help: if you would like to deref, try using `&**`
|
183 | let t: &str = &**s;
| ~~~~