Skip to content

Added Mips related compoennts, change wire ui, new UI helpers, new misc compoents #312

Added Mips related compoennts, change wire ui, new UI helpers, new misc compoents

Added Mips related compoennts, change wire ui, new UI helpers, new misc compoents #312

Triggered via pull request September 26, 2024 09:25
Status Failure
Total duration 9m 45s
Artifacts

rust.yml

on: pull_request
rustfmt
9s
rustfmt
Matrix: build
Fit to window
Zoom out
Zoom in

Annotations

3 errors and 42 warnings
build (x86_64-apple-darwin)
Process completed with exit code 101.
build (x86_64-pc-windows-gnu)
Process completed with exit code 101.
build (x86_64-unknown-linux-musl)
Process completed with exit code 101.
build (x86_64-apple-darwin)
Unexpected input(s) 'token', valid inputs are ['toolchain', 'args', 'use-cross', 'working-directory']
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/clk.rs#L52
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/clk.rs:52:9 | 52 | / match target_port_id.as_str() { 53 | | CLK_IN_ID => self.clk_in = new_input, 54 | | _ => {} 55 | | } | |_________^ help: try: `if target_port_id.as_str() == &CLK_IN_ID { self.clk_in = new_input }` | = 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
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/shift_left_const.rs#L54
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/shift_left_const.rs:54:9 | 54 | / match target_port_id.as_str() { 55 | | SHIFT_SIGNAL_IN_ID => self.signal_in = new_input, 56 | | _ => {} 57 | | } | |_________^ help: try: `if target_port_id.as_str() == &SHIFT_SIGNAL_IN_ID { self.signal_in = new_input }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/zero_extend.rs#L52
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/zero_extend.rs:52:9 | 52 | / match target_port_id.as_str() { 53 | | ZEROEXTEND_SIGNAL_IN_ID => self.signal_in = new_input, 54 | | _ => {} 55 | | } | |_________^ help: try: `if target_port_id.as_str() == &ZEROEXTEND_SIGNAL_IN_ID { self.signal_in = new_input }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
build (x86_64-apple-darwin)
Unexpected input(s) 'token', valid inputs are ['toolchain', 'args', 'use-cross', 'working-directory']
unused import: `Pos2`: src/gui_egui/components/and.rs#L6
warning: unused import: `Pos2` --> src/gui_egui/components/and.rs:6:18 | 6 | use egui::{pos2, Pos2, Rect, Response, Ui, Vec2}; | ^^^^ | = note: `#[warn(unused_imports)]` on by default
unused import: `self`: src/gui_egui/components/register.rs#L1
warning: unused import: `self` --> src/gui_egui/components/register.rs:1:21 | 1 | use crate::common::{self, EguiComponent, Input, Ports, SignalUnsigned, Simulator}; | ^^^^
unused import: `crate::component_store`: src/gui_egui/components/register.rs#L2
warning: unused import: `crate::component_store` --> src/gui_egui/components/register.rs:2:5 | 2 | use crate::component_store; | ^^^^^^^^^^^^^^^^^^^^^^
unneeded `return` statement: src/gui_egui/components/register.rs#L183
warning: unneeded `return` statement --> src/gui_egui/components/register.rs:183:9 | 183 | return self.get_pos().into(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 183 - return self.get_pos().into(); 183 + self.get_pos().into() |
this `if` statement can be collapsed: src/gui_egui/components/wire.rs#L135
warning: this `if` statement can be collapsed --> src/gui_egui/components/wire.rs:135:17 | 135 | / if min_from_line(first_pos.to_vec2(), last_pos.to_vec2(), cursor.to_vec2()) 136 | | < TOOLTIP_DISTANCE 137 | | && clip_rect.contains(cursor) 138 | | { ... | 148 | | } 149 | | } | |_________________^ | = 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 | 135 ~ if min_from_line(first_pos.to_vec2(), last_pos.to_vec2(), cursor.to_vec2()) 136 + < TOOLTIP_DISTANCE && clip_rect.contains(cursor) && !hovered { 137 + hovered = true; 138 + egui::containers::popup::show_tooltip_at( 139 + ui.ctx(), 140 + ui.layer_id(), 141 + egui::Id::new(&self.id), 142 + (first_pos + last_pos.to_vec2()) / 2.0, 143 + |ui| basic_on_hover(ui, self, &simulator), 144 + ); 145 + } |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/gui_egui/components/wire.rs#L97
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/gui_egui/components/wire.rs:97:13 | 97 | / match editor_mode { 98 | | EditorMode::Default => { 99 | | // why the fuck do i need this much code just to make sure its rendered at the correct layer 100 | | let resp = ui ... | 131 | | _ => {} 132 | | }; | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 97 ~ if let EditorMode::Default = editor_mode { 98 + // why the fuck do i need this much code just to make sure its rendered at the correct layer 99 + let resp = ui 100 + .allocate_ui_at_rect(rect, |ui| { 101 + let mut layer = ui.layer_id(); 102 + layer.order = Order::Middle; 103 + ui.with_layer_id(layer, |ui| { 104 + ui.allocate_exact_size( 105 + rect.size(), 106 + Sense { 107 + click: true, 108 + drag: true, 109 + focusable: true, 110 + }, 111 + ) 112 + }) 113 + }) 114 + .inner 115 + .inner 116 + .1; 117 + // log::debug!("{:?}", resp); 118 + if resp.contains_pointer() { 119 + ui.painter().rect_stroke( 120 + resp.interact_rect, 121 + Rounding::same(0.0), 122 + Stroke { 123 + width: scale, 124 + color: Color32::RED, 125 + }, 126 + ); 127 + } 128 + r.push(resp); 129 ~ }; |
using `clone` on type `(f32, f32)` which implements the `Copy` trait: src/gui_egui/components/wire.rs#L295
warning: using `clone` on type `(f32, f32)` which implements the `Copy` trait --> src/gui_egui/components/wire.rs:295:54 | 295 | ... to_insert = Some((i, seg_pos.clone())); | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*seg_pos` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/clk.rs#L52
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/clk.rs:52:9 | 52 | / match target_port_id.as_str() { 53 | | CLK_IN_ID => self.clk_in = new_input, 54 | | _ => {} 55 | | } | |_________^ help: try: `if target_port_id.as_str() == &CLK_IN_ID { self.clk_in = new_input }` | = 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
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/shift_left_const.rs#L54
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/shift_left_const.rs:54:9 | 54 | / match target_port_id.as_str() { 55 | | SHIFT_SIGNAL_IN_ID => self.signal_in = new_input, 56 | | _ => {} 57 | | } | |_________^ help: try: `if target_port_id.as_str() == &SHIFT_SIGNAL_IN_ID { self.signal_in = new_input }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
build (x86_64-pc-windows-gnu)
Unexpected input(s) 'token', valid inputs are ['toolchain', 'args', 'use-cross', 'working-directory']
unused import: `Pos2`: src/gui_egui/components/and.rs#L6
warning: unused import: `Pos2` --> src/gui_egui/components/and.rs:6:18 | 6 | use egui::{pos2, Pos2, Rect, Response, Ui, Vec2}; | ^^^^ | = note: `#[warn(unused_imports)]` on by default
unused import: `self`: src/gui_egui/components/register.rs#L1
warning: unused import: `self` --> src/gui_egui/components/register.rs:1:21 | 1 | use crate::common::{self, EguiComponent, Input, Ports, SignalUnsigned, Simulator}; | ^^^^
unused import: `crate::component_store`: src/gui_egui/components/register.rs#L2
warning: unused import: `crate::component_store` --> src/gui_egui/components/register.rs:2:5 | 2 | use crate::component_store; | ^^^^^^^^^^^^^^^^^^^^^^
unneeded `return` statement: src/gui_egui/components/register.rs#L183
warning: unneeded `return` statement --> src/gui_egui/components/register.rs:183:9 | 183 | return self.get_pos().into(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 183 - return self.get_pos().into(); 183 + self.get_pos().into() |
this `if` statement can be collapsed: src/gui_egui/components/wire.rs#L135
warning: this `if` statement can be collapsed --> src/gui_egui/components/wire.rs:135:17 | 135 | / if min_from_line(first_pos.to_vec2(), last_pos.to_vec2(), cursor.to_vec2()) 136 | | < TOOLTIP_DISTANCE 137 | | && clip_rect.contains(cursor) 138 | | { ... | 148 | | } 149 | | } | |_________________^ | = 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 | 135 ~ if min_from_line(first_pos.to_vec2(), last_pos.to_vec2(), cursor.to_vec2()) 136 + < TOOLTIP_DISTANCE && clip_rect.contains(cursor) && !hovered { 137 + hovered = true; 138 + egui::containers::popup::show_tooltip_at( 139 + ui.ctx(), 140 + ui.layer_id(), 141 + egui::Id::new(&self.id), 142 + (first_pos + last_pos.to_vec2()) / 2.0, 143 + |ui| basic_on_hover(ui, self, &simulator), 144 + ); 145 + } |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/gui_egui/components/wire.rs#L97
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/gui_egui/components/wire.rs:97:13 | 97 | / match editor_mode { 98 | | EditorMode::Default => { 99 | | // why the fuck do i need this much code just to make sure its rendered at the correct layer 100 | | let resp = ui ... | 131 | | _ => {} 132 | | }; | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 97 ~ if let EditorMode::Default = editor_mode { 98 + // why the fuck do i need this much code just to make sure its rendered at the correct layer 99 + let resp = ui 100 + .allocate_ui_at_rect(rect, |ui| { 101 + let mut layer = ui.layer_id(); 102 + layer.order = Order::Middle; 103 + ui.with_layer_id(layer, |ui| { 104 + ui.allocate_exact_size( 105 + rect.size(), 106 + Sense { 107 + click: true, 108 + drag: true, 109 + focusable: true, 110 + }, 111 + ) 112 + }) 113 + }) 114 + .inner 115 + .inner 116 + .1; 117 + // log::debug!("{:?}", resp); 118 + if resp.contains_pointer() { 119 + ui.painter().rect_stroke( 120 + resp.interact_rect, 121 + Rounding::same(0.0), 122 + Stroke { 123 + width: scale, 124 + color: Color32::RED, 125 + }, 126 + ); 127 + } 128 + r.push(resp); 129 ~ }; |
using `clone` on type `(f32, f32)` which implements the `Copy` trait: src/gui_egui/components/wire.rs#L295
warning: using `clone` on type `(f32, f32)` which implements the `Copy` trait --> src/gui_egui/components/wire.rs:295:54 | 295 | ... to_insert = Some((i, seg_pos.clone())); | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*seg_pos` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/clk.rs#L52
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/clk.rs:52:9 | 52 | / match target_port_id.as_str() { 53 | | CLK_IN_ID => self.clk_in = new_input, 54 | | _ => {} 55 | | } | |_________^ help: try: `if target_port_id.as_str() == &CLK_IN_ID { self.clk_in = new_input }` | = 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
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/shift_left_const.rs#L54
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/shift_left_const.rs:54:9 | 54 | / match target_port_id.as_str() { 55 | | SHIFT_SIGNAL_IN_ID => self.signal_in = new_input, 56 | | _ => {} 57 | | } | |_________^ help: try: `if target_port_id.as_str() == &SHIFT_SIGNAL_IN_ID { self.signal_in = new_input }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
build (x86_64-pc-windows-gnu)
Unexpected input(s) 'token', valid inputs are ['toolchain', 'args', 'use-cross', 'working-directory']
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/clk.rs#L52
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/clk.rs:52:9 | 52 | / match target_port_id.as_str() { 53 | | CLK_IN_ID => self.clk_in = new_input, 54 | | _ => {} 55 | | } | |_________^ help: try: `if target_port_id.as_str() == &CLK_IN_ID { self.clk_in = new_input }` | = 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
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/shift_left_const.rs#L54
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/shift_left_const.rs:54:9 | 54 | / match target_port_id.as_str() { 55 | | SHIFT_SIGNAL_IN_ID => self.signal_in = new_input, 56 | | _ => {} 57 | | } | |_________^ help: try: `if target_port_id.as_str() == &SHIFT_SIGNAL_IN_ID { self.signal_in = new_input }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/zero_extend.rs#L52
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/zero_extend.rs:52:9 | 52 | / match target_port_id.as_str() { 53 | | ZEROEXTEND_SIGNAL_IN_ID => self.signal_in = new_input, 54 | | _ => {} 55 | | } | |_________^ help: try: `if target_port_id.as_str() == &ZEROEXTEND_SIGNAL_IN_ID { self.signal_in = new_input }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
build (x86_64-unknown-linux-musl)
Unexpected input(s) 'token', valid inputs are ['toolchain', 'args', 'use-cross', 'working-directory']
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/clk.rs#L52
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/clk.rs:52:9 | 52 | / match target_port_id.as_str() { 53 | | CLK_IN_ID => self.clk_in = new_input, 54 | | _ => {} 55 | | } | |_________^ help: try: `if target_port_id.as_str() == &CLK_IN_ID { self.clk_in = new_input }` | = 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
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/shift_left_const.rs#L54
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/shift_left_const.rs:54:9 | 54 | / match target_port_id.as_str() { 55 | | SHIFT_SIGNAL_IN_ID => self.signal_in = new_input, 56 | | _ => {} 57 | | } | |_________^ help: try: `if target_port_id.as_str() == &SHIFT_SIGNAL_IN_ID { self.signal_in = new_input }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/zero_extend.rs#L52
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/zero_extend.rs:52:9 | 52 | / match target_port_id.as_str() { 53 | | ZEROEXTEND_SIGNAL_IN_ID => self.signal_in = new_input, 54 | | _ => {} 55 | | } | |_________^ help: try: `if target_port_id.as_str() == &ZEROEXTEND_SIGNAL_IN_ID { self.signal_in = new_input }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match
build (x86_64-unknown-linux-musl)
Unexpected input(s) 'token', valid inputs are ['toolchain', 'args', 'use-cross', 'working-directory']
unused import: `Pos2`: src/gui_egui/components/and.rs#L6
warning: unused import: `Pos2` --> src/gui_egui/components/and.rs:6:18 | 6 | use egui::{pos2, Pos2, Rect, Response, Ui, Vec2}; | ^^^^ | = note: `#[warn(unused_imports)]` on by default
unused import: `self`: src/gui_egui/components/register.rs#L1
warning: unused import: `self` --> src/gui_egui/components/register.rs:1:21 | 1 | use crate::common::{self, EguiComponent, Input, Ports, SignalUnsigned, Simulator}; | ^^^^
unused import: `crate::component_store`: src/gui_egui/components/register.rs#L2
warning: unused import: `crate::component_store` --> src/gui_egui/components/register.rs:2:5 | 2 | use crate::component_store; | ^^^^^^^^^^^^^^^^^^^^^^
unneeded `return` statement: src/gui_egui/components/register.rs#L183
warning: unneeded `return` statement --> src/gui_egui/components/register.rs:183:9 | 183 | return self.get_pos().into(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return help: remove `return` | 183 - return self.get_pos().into(); 183 + self.get_pos().into() |
this `if` statement can be collapsed: src/gui_egui/components/wire.rs#L135
warning: this `if` statement can be collapsed --> src/gui_egui/components/wire.rs:135:17 | 135 | / if min_from_line(first_pos.to_vec2(), last_pos.to_vec2(), cursor.to_vec2()) 136 | | < TOOLTIP_DISTANCE 137 | | && clip_rect.contains(cursor) 138 | | { ... | 148 | | } 149 | | } | |_________________^ | = 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 | 135 ~ if min_from_line(first_pos.to_vec2(), last_pos.to_vec2(), cursor.to_vec2()) 136 + < TOOLTIP_DISTANCE && clip_rect.contains(cursor) && !hovered { 137 + hovered = true; 138 + egui::containers::popup::show_tooltip_at( 139 + ui.ctx(), 140 + ui.layer_id(), 141 + egui::Id::new(&self.id), 142 + (first_pos + last_pos.to_vec2()) / 2.0, 143 + |ui| basic_on_hover(ui, self, &simulator), 144 + ); 145 + } |
you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`: src/gui_egui/components/wire.rs#L97
warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/gui_egui/components/wire.rs:97:13 | 97 | / match editor_mode { 98 | | EditorMode::Default => { 99 | | // why the fuck do i need this much code just to make sure its rendered at the correct layer 100 | | let resp = ui ... | 131 | | _ => {} 132 | | }; | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match help: try | 97 ~ if let EditorMode::Default = editor_mode { 98 + // why the fuck do i need this much code just to make sure its rendered at the correct layer 99 + let resp = ui 100 + .allocate_ui_at_rect(rect, |ui| { 101 + let mut layer = ui.layer_id(); 102 + layer.order = Order::Middle; 103 + ui.with_layer_id(layer, |ui| { 104 + ui.allocate_exact_size( 105 + rect.size(), 106 + Sense { 107 + click: true, 108 + drag: true, 109 + focusable: true, 110 + }, 111 + ) 112 + }) 113 + }) 114 + .inner 115 + .inner 116 + .1; 117 + // log::debug!("{:?}", resp); 118 + if resp.contains_pointer() { 119 + ui.painter().rect_stroke( 120 + resp.interact_rect, 121 + Rounding::same(0.0), 122 + Stroke { 123 + width: scale, 124 + color: Color32::RED, 125 + }, 126 + ); 127 + } 128 + r.push(resp); 129 ~ }; |
using `clone` on type `(f32, f32)` which implements the `Copy` trait: src/gui_egui/components/wire.rs#L295
warning: using `clone` on type `(f32, f32)` which implements the `Copy` trait --> src/gui_egui/components/wire.rs:295:54 | 295 | ... to_insert = Some((i, seg_pos.clone())); | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*seg_pos` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy = note: `#[warn(clippy::clone_on_copy)]` on by default
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/clk.rs#L52
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/clk.rs:52:9 | 52 | / match target_port_id.as_str() { 53 | | CLK_IN_ID => self.clk_in = new_input, 54 | | _ => {} 55 | | } | |_________^ help: try: `if target_port_id.as_str() == &CLK_IN_ID { self.clk_in = new_input }` | = 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
you seem to be trying to use `match` for an equality check. Consider using `if`: src/components/shift_left_const.rs#L54
warning: you seem to be trying to use `match` for an equality check. Consider using `if` --> src/components/shift_left_const.rs:54:9 | 54 | / match target_port_id.as_str() { 55 | | SHIFT_SIGNAL_IN_ID => self.signal_in = new_input, 56 | | _ => {} 57 | | } | |_________^ help: try: `if target_port_id.as_str() == &SHIFT_SIGNAL_IN_ID { self.signal_in = new_input }` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match