feat(tracker): add history capabilities for all tracks #188
clippy
4 warnings
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 0 |
Warning | 4 |
Note | 0 |
Help | 0 |
Versions
- rustc 1.73.0 (cc66ad468 2023-10-03)
- cargo 1.73.0 (9c4383fb5 2023-08-26)
- clippy 0.1.73 (cc66ad4 2023-10-03)
Annotations
Check warning on line 139 in mfm_machine/src/state_machine/mod.rs
github-actions / clippy
unused `std::result::Result` that must be used
warning: unused `std::result::Result` that must be used
--> mfm_machine/src/state_machine/mod.rs:136:9
|
136 | / self.tracker.as_mut().track(
137 | | Index::new(next_state_index, state.label(), state.tags()),
138 | | context.clone(),
139 | | );
| |_________^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
136 | let _ = self.tracker.as_mut().track(
| +++++++
Check warning on line 36 in mfm_machine/src/state_machine/tracker.rs
github-actions / clippy
struct `TrackerHistory` has a public `len` method, but no `is_empty` method
warning: struct `TrackerHistory` has a public `len` method, but no `is_empty` method
--> mfm_machine/src/state_machine/tracker.rs:36:5
|
36 | pub fn len(&self) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty
= note: `#[warn(clippy::len_without_is_empty)]` on by default
Check warning on line 34 in mfm_machine/src/state_machine/tracker.rs
github-actions / clippy
you should consider adding a `Default` implementation for `TrackerHistory`
warning: you should consider adding a `Default` implementation for `TrackerHistory`
--> mfm_machine/src/state_machine/tracker.rs:32:5
|
32 | / pub fn new() -> Self {
33 | | TrackerHistory(Vec::new())
34 | | }
| |_____^
|
= 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
|
31 + impl Default for TrackerHistory {
32 + fn default() -> Self {
33 + Self::new()
34 + }
35 + }
|
Check warning on line 27 in mfm_machine/src/state_machine/tracker.rs
github-actions / clippy
`.map().collect()` can be replaced with `.try_for_each()`
warning: `.map().collect()` can be replaced with `.try_for_each()`
--> mfm_machine/src/state_machine/tracker.rs:18:9
|
18 | / self.0
19 | | .iter()
20 | | .map(|(history_id, index, _)| {
21 | | writeln!(
... |
26 | | })
27 | | .collect()
| |______________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_collect_result_unit
= note: `#[warn(clippy::map_collect_result_unit)]` on by default
help: try
|
18 ~ self.0
19 + .iter().try_for_each(|(history_id, index, _)| {
20 + writeln!(
21 + f,
22 + "history_id ({}); index ({:?}); context (ptr)",
23 + history_id, index
24 + )
25 + })
|