Skip to content

Default enable state setting #309

Default enable state setting

Default enable state setting #309

Triggered via push January 29, 2025 23:38
Status Failure
Total duration 40s
Artifacts

rust.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

7 errors
call to `reserve` immediately after creation: rust/rust/src/flowgraph.rs#L57
error: call to `reserve` immediately after creation --> ./rust/rust/src/flowgraph.rs:57:9 | 57 | / let mut result = vec![]; 58 | | result.reserve(count); | |______________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut result = Vec::with_capacity(count);` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization = note: `-D clippy::reserve-after-initialization` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::reserve_after_initialization)]`
the loop variable `i` is only used to index `nodes`: rust/rust/src/flowgraph.rs#L60
error: the loop variable `i` is only used to index `nodes` --> ./rust/rust/src/flowgraph.rs:60:18 | 60 | for i in 0..count { | ^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop = note: `-D clippy::needless-range-loop` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::needless_range_loop)]` help: consider using an iterator | 60 | for <item> in nodes.iter().take(count) { | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
method `next` can be confused for the standard trait method `std::iter::Iterator::next`: rust/rust/src/linear_view.rs#L336
error: method `next` can be confused for the standard trait method `std::iter::Iterator::next` --> ./rust/rust/src/linear_view.rs:336:5 | 336 | / pub fn next(&mut self) -> bool { 337 | | unsafe { BNLinearViewCursorNext(self.handle) } 338 | | } | |_____^ | = help: consider implementing the trait `std::iter::Iterator` or choosing a less ambiguous method name = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait = note: `-D clippy::should-implement-trait` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::should_implement_trait)]`
called `map(..).flatten()` on `Iterator`: rust/rust/src/render_layer.rs#L112
error: called `map(..).flatten()` on `Iterator` --> ./rust/rust/src/render_layer.rs:112:14 | 112 | .map(|(line_ty, basic_block, lines)| { | ______________^ 113 | | match line_ty { 114 | | LinearDisassemblyLineType::CodeDisassemblyLineType => { 115 | | // Dealing with code lines. ... | 136 | | }) 137 | | .flatten() | |______________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten = note: `-D clippy::map-flatten` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::map_flatten)]` help: try replacing `map` with `flat_map` and remove the `.flatten()` | 112 ~ .flat_map(|(line_ty, basic_block, lines)| { 113 + match line_ty { 114 + LinearDisassemblyLineType::CodeDisassemblyLineType => { 115 + // Dealing with code lines. 116 + let block = basic_block.expect("Code line has no basic block"); 117 + let function = block.function(); 118 + let text_lines = lines.into_iter().map(|line| line.contents).collect(); 119 + let new_text_lines = self.apply_to_block(&block, text_lines); 120 + let new_lines = new_text_lines 121 + .into_iter() 122 + .map(|line| text_to_lines(&function, &block, line)) 123 + .collect(); 124 + new_lines 125 + } 126 + _ => { 127 + // Dealing with misc lines. 128 + self.apply_to_misc_lines( 129 + object, 130 + _prev_object.as_deref(), 131 + _next_object.as_deref(), 132 + lines, 133 + ) 134 + } 135 + } 136 + }) |
returning the result of a `let` binding from a block: rust/rust/src/render_layer.rs#L124
error: returning the result of a `let` binding from a block --> ./rust/rust/src/render_layer.rs:124:25 | 120 | / let new_lines = new_text_lines 121 | | .into_iter() 122 | | .map(|line| text_to_lines(&function, &block, line)) 123 | | .collect(); | |_______________________________________- unnecessary `let` binding 124 | new_lines | ^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return = note: `-D clippy::let-and-return` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::let_and_return)]` help: return the expression directly | 120 ~ 121 ~ new_text_lines 122 + .into_iter() 123 + .map(|line| text_to_lines(&function, &block, line)) 124 + .collect() |
redundant closure: rust/rust/src/render_layer.rs#L261
error: redundant closure --> ./rust/rust/src/render_layer.rs:261:34 | 261 | NonNull::new(result).map(|x| Self::from_raw(x)) | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `Self::from_raw` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure = note: `-D clippy::redundant-closure` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::redundant_closure)]`
cargo clippy
Error: Clippy has exited with exit code 101