Merge remote-tracking branch 'origin/develop' into develop #41
clippy
251 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 251 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.81.0 (eeb90cda1 2024-09-04)
- cargo 1.81.0 (2dbb1af80 2024-08-20)
- clippy 0.1.81 (eeb90cd 2024-09-04)
Annotations
Check warning on line 155 in core/src/lib.rs
github-actions / clippy
you should consider adding a `Default` implementation for `DisableStdoutLogger`
warning: you should consider adding a `Default` implementation for `DisableStdoutLogger`
--> core/src/lib.rs:146:5
|
146 | / pub fn new() -> DisableStdoutLogger {
147 | | if STDOUT_DISABLE_RC.fetch_add(1, Ordering::Relaxed) == 0 {
148 | | //If no previous instances were created, disable the stdout/stderr logger.
149 | | //First, flush any waiting message.
... |
154 | | DisableStdoutLogger
155 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `#[warn(clippy::new_without_default)]` on by default
help: try adding this
|
144 + impl Default for DisableStdoutLogger {
145 + fn default() -> Self {
146 + Self::new()
147 + }
148 + }
|
Check warning on line 123 in core/src/lib.rs
github-actions / clippy
needless `fn main` in doctest
warning: needless `fn main` in doctest
--> core/src/lib.rs:120:5
|
120 | /// fn main() {
| _____^
121 | | /// bp3d_tracing::setup!("my-super-app");
122 | | /// // ... application code goes here
123 | | /// }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
= note: `#[warn(clippy::needless_doctest_main)]` on by default
github-actions / clippy
length comparison to one
warning: length comparison to one
--> /home/runner/work/debug.tracing/debug.tracing/target/debug/build/bp3d-tracing-75baf281adae05e3/out/value/structures.rs:1214:12
|
1214 | if self.data.as_ref().len() < 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.data.as_ref().is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
github-actions / clippy
length comparison to one
warning: length comparison to one
--> /home/runner/work/debug.tracing/debug.tracing/target/debug/build/bp3d-tracing-75baf281adae05e3/out/value/structures.rs:1102:12
|
1102 | if self.data.as_ref().len() < 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.data.as_ref().is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
github-actions / clippy
length comparison to one
warning: length comparison to one
--> /home/runner/work/debug.tracing/debug.tracing/target/debug/build/bp3d-tracing-75baf281adae05e3/out/value/structures.rs:462:12
|
462 | if self.data.as_ref().len() < 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.data.as_ref().is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
github-actions / clippy
length comparison to one
warning: length comparison to one
--> /home/runner/work/debug.tracing/debug.tracing/target/debug/build/bp3d-tracing-75baf281adae05e3/out/value/structures.rs:30:12
|
30 | if self.data.as_ref().len() < 1 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.data.as_ref().is_empty()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
= note: `#[warn(clippy::len_zero)]` on by default
Check warning on line 122 in core/src/profiler/core2.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> core/src/profiler/core2.rs:119:9
|
119 | / let _ = self.channels.execution.send(Execution::SpanExit {
120 | | id,
121 | | end: data.end()
122 | | });
| |___________^
|
= 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 110 in core/src/profiler/core2.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> core/src/profiler/core2.rs:110:13
|
110 | let _ = self.channels.execution.send(Execution::SpanRecord(fieldset));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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 100 in core/src/profiler/core2.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> core/src/profiler/core2.rs:97:9
|
97 | / let _ = self.channels.execution.send(Execution::SpanEnter {
98 | | fields: fieldset.clone(),
99 | | start: fieldset.start()
100 | | });
| |___________^
|
= 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 82 in core/src/profiler/core2.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> core/src/profiler/core2.rs:79:9
|
79 | / let _ = self.channels.control.send(Control::RegisterSpan {
80 | | callsite,
81 | | id
82 | | });
| |___________^
|
= 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 72 in core/src/profiler/core2.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> core/src/profiler/core2.rs:72:9
|
72 | let _ = self.channels.execution.send(Execution::ProfilerRecord(record));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= 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 64 in core/src/profiler/core2.rs
github-actions / clippy
non-binding `let` on a future
warning: non-binding `let` on a future
--> core/src/profiler/core2.rs:60:9
|
60 | / let _ = self.channels.control.send(Control::RegisterSection {
61 | | section,
62 | | id,
63 | | parent: section.parent().map(|v| *v.get_id())
64 | | });
| |___________^
|
= 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 33 in core/src/profiler/thread/util.rs
github-actions / clippy
methods called `from_*` usually take no `self`
warning: methods called `from_*` usually take no `self`
--> core/src/profiler/thread/util.rs:33:21
|
33 | pub fn from_std(&mut self, value: &std::time::Duration) -> &mut Self {
| ^^^^^^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
Check warning on line 314 in core/src/profiler/thread/core.rs
github-actions / clippy
called `map(..).flatten()` on `Option`
warning: called `map(..).flatten()` on `Option`
--> core/src/profiler/thread/core.rs:313:34
|
313 | ... .map(|v| if v == net::event::Level::None { None } else { Some(v) })
| ________________________^
314 | | ... .flatten(),
| |________________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|v| if v == net::event::Level::None { None } else { Some(v) })`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
Check warning on line 311 in core/src/profiler/thread/core.rs
github-actions / clippy
called `map(..).flatten()` on `Option`
warning: called `map(..).flatten()` on `Option`
--> core/src/profiler/thread/core.rs:310:34
|
310 | ... .map(|v| if v == net::profiler::Level::None { None } else { Some(v) })
| ________________________^
311 | | ... .flatten(),
| |________________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|v| if v == net::profiler::Level::None { None } else { Some(v) })`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten
= note: `#[warn(clippy::map_flatten)]` on by default
Check warning on line 303 in core/src/profiler/thread/core.rs
github-actions / clippy
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
--> core/src/profiler/thread/core.rs:298:17
|
298 | / match cmd.unwrap() {
299 | | Control::Terminate => {
300 | | return;
301 | | },
302 | | _ => ()
303 | | }
| |_________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
= note: `#[warn(clippy::single_match)]` on by default
help: try
|
298 ~ if let Control::Terminate = cmd.unwrap() {
299 + return;
300 + }
|
Check warning on line 300 in core/src/profiler/thread/core.rs
github-actions / clippy
unneeded `return` statement
warning: unneeded `return` statement
--> core/src/profiler/thread/core.rs:299:44
|
299 | Control::Terminate => {
| ____________________________________________^
300 | | return;
| |______________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
|
299 - Control::Terminate => {
300 - return;
299 + Control::Terminate => {
|
Check warning on line 53 in core/src/profiler/thread/command.rs
github-actions / clippy
large size difference between variants
warning: large size difference between variants
--> core/src/profiler/thread/command.rs:34:1
|
34 | / pub enum Control {
35 | | / Project {
36 | | | app_name: FixedBufStr<63>,
37 | | | name: FixedBufStr<63>,
38 | | | version: FixedBufStr<63>,
39 | | | },
| | |_____- the largest variant contains at least 216 bytes
... |
47 | | / RegisterSpan {
48 | | | callsite: &'static bp3d_debug::trace::span::Callsite,
49 | | | id: NonZeroU32
50 | | | },
| | |_____- the second-largest variant contains at least 12 bytes
51 | |
52 | | Terminate,
53 | | }
| |___^ the entire enum is at least 0 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
= note: `#[warn(clippy::large_enum_variant)]` on by default
help: consider boxing the large fields to reduce the total size of the enum
|
38 | version: Box<FixedBufStr<63>>,
| ~~~~~~~~~~~~~~~~~~~~
Check warning on line 92 in core/src/profiler/log_msg.rs
github-actions / clippy
transmute used without annotations
warning: transmute used without annotations
--> core/src/profiler/log_msg.rs:92:35
|
92 | std::mem::transmute(self.buffer.as_mut_ptr().offset(self.msg_len as _)),
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<*mut std::mem::MaybeUninit<u8>, *mut u8>`
...
208 | impl_log_msg!(EventLog);
| ----------------------- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
= note: this warning originates in the macro `impl_log_msg` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 92 in core/src/profiler/log_msg.rs
github-actions / clippy
transmute used without annotations
warning: transmute used without annotations
--> core/src/profiler/log_msg.rs:92:35
|
92 | std::mem::transmute(self.buffer.as_mut_ptr().offset(self.msg_len as _)),
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<*mut std::mem::MaybeUninit<u8>, *mut u8>`
...
164 | impl_log_msg!(FieldsetRecord);
| ----------------------------- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
= note: this warning originates in the macro `impl_log_msg` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 92 in core/src/profiler/log_msg.rs
github-actions / clippy
transmute used without annotations
warning: transmute used without annotations
--> core/src/profiler/log_msg.rs:92:35
|
92 | std::mem::transmute(self.buffer.as_mut_ptr().offset(self.msg_len as _)),
| ^^^^^^^^^ help: consider adding missing annotations: `transmute::<*mut std::mem::MaybeUninit<u8>, *mut u8>`
...
112 | impl_log_msg!(ProfilerRecord);
| ----------------------------- in this macro invocation
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
= note: `#[warn(clippy::missing_transmute_annotations)]` on by default
= note: this warning originates in the macro `impl_log_msg` (in Nightly builds, run with -Z macro-backtrace for more info)
Check warning on line 144 in core/src/config/model.rs
github-actions / clippy
this `impl` can be derived
warning: this `impl` can be derived
--> core/src/config/model.rs:136:1
|
136 | / impl Default for Config {
137 | | fn default() -> Self {
138 | | Self {
139 | | mode: None,
... |
143 | | }
144 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls
= note: `#[warn(clippy::derivable_impls)]` on by default
= help: remove the manual implementation...
help: ...and instead derive it
|
130 + #[derive(Default)]
131 | pub struct Config {
|
Check warning on line 55 in core/src/config/model.rs
github-actions / clippy
methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value
warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value
--> core/src/config/model.rs:55:26
|
55 | pub fn to_bp3d_debug(&self) -> bp3d_debug::logger::Level {
| ^^^^^
|
= help: consider choosing a less ambiguous name
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention
= note: `#[warn(clippy::wrong_self_convention)]` on by default
github-actions / clippy
methods `set_raw_max_rows`, `set_max_rows`, `set_raw_min_period`, and `set_min_period` are never used
warning: methods `set_raw_max_rows`, `set_max_rows`, `set_raw_min_period`, and `set_min_period` are never used
--> /home/runner/work/debug.tracing/debug.tracing/target/debug/build/bp3d-tracing-75baf281adae05e3/out/server/structures.rs:97:12
|
96 | impl<T: AsMut<[u8]>> Config<T> {
| ------------------------------ methods in this implementation
97 | pub fn set_raw_max_rows(&mut self, value: u32) {
| ^^^^^^^^^^^^^^^^
...
101 | pub fn set_max_rows(&mut self, value: u32) -> &mut Self {
| ^^^^^^^^^^^^
...
105 | pub fn set_raw_min_period(&mut self, value: u16) {
| ^^^^^^^^^^^^^^^^^^
...
109 | pub fn set_min_period(&mut self, value: u16) -> &mut Self {
| ^^^^^^^^^^^^^^
github-actions / clippy
methods `get_raw_max_rows`, `get_max_rows`, `get_raw_min_period`, and `get_min_period` are never used
warning: methods `get_raw_max_rows`, `get_max_rows`, `get_raw_min_period`, and `get_min_period` are never used
--> /home/runner/work/debug.tracing/debug.tracing/target/debug/build/bp3d-tracing-75baf281adae05e3/out/server/structures.rs:80:12
|
79 | impl<T: AsRef<[u8]>> Config<T> {
| ------------------------------ methods in this implementation
80 | pub fn get_raw_max_rows(&self) -> u32 {
| ^^^^^^^^^^^^^^^^
...
84 | pub fn get_max_rows(&self) -> u32 {
| ^^^^^^^^^^^^
...
87 | pub fn get_raw_min_period(&self) -> u16 {
| ^^^^^^^^^^^^^^^^^^
...
91 | pub fn get_min_period(&self) -> u16 {
| ^^^^^^^^^^^^^^