From c9e3ae52ce9ab8390f95481fbc2d5ef3e27486a3 Mon Sep 17 00:00:00 2001 From: starlord Date: Tue, 7 Nov 2023 23:53:56 +0400 Subject: [PATCH] Linter step (#104) --- .github/workflows/rust.yml | 7 +++++++ src/graph_view.rs | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 009bd15..b624997 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -17,6 +17,13 @@ jobs: - name: Build run: cargo build --verbose + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Lint + run: cargo clippy --verbose -- -D warnings + test: runs-on: ubuntu-latest steps: diff --git a/src/graph_view.rs b/src/graph_view.rs index bdd30e2..2da1100 100644 --- a/src/graph_view.rs +++ b/src/graph_view.rs @@ -375,11 +375,13 @@ impl<'a, N: Clone, E: Clone, Ty: EdgeType> GraphView<'a, N, E, Ty> { self.publish_event(Event::NodeDeselect(PayloadNodeDeselect { id: idx.index() })); } + #[allow(unused_variables)] fn set_node_clicked(&mut self, idx: NodeIndex) { #[cfg(feature = "events")] self.publish_event(Event::NodeClick(PayloadNodeClick { id: idx.index() })); } + #[allow(unused_variables)] fn set_node_double_clicked(&mut self, idx: NodeIndex) { #[cfg(feature = "events")] self.publish_event(Event::NodeDoubleClick(PayloadNodeDoubleClick { @@ -422,6 +424,7 @@ impl<'a, N: Clone, E: Clone, Ty: EdgeType> GraphView<'a, N, E, Ty> { self.publish_event(Event::NodeDragEnd(PayloadNodeDragEnd { id: idx.index() })); } + #[allow(unused_variables)] fn set_pan(&self, val: Vec2, meta: &mut Metadata) { let diff = val - meta.pan; meta.pan = val; @@ -430,6 +433,7 @@ impl<'a, N: Clone, E: Clone, Ty: EdgeType> GraphView<'a, N, E, Ty> { self.publish_event(Event::Pan(PayloadPan { diff: diff.into() })); } + #[allow(unused_variables)] fn set_zoom(&self, val: f32, meta: &mut Metadata) { let diff = val - meta.zoom; meta.zoom = val;