From 253b1ca0c95943e9edf1bb1d9ad1d9ba6510dd69 Mon Sep 17 00:00:00 2001 From: tupe12334 Date: Thu, 11 Jun 2026 19:04:01 +0300 Subject: [PATCH] ci: add cargo doc -D warnings check, fix rustdoc [*] escaping --- .github/workflows/ci.yml | 3 +++ core/src/flow.rs | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bc25a7..4efbc7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,6 +41,9 @@ jobs: - name: Run tests run: cargo test --manifest-path core/Cargo.toml + - name: Check docs + run: RUSTDOCFLAGS="-D warnings" cargo doc --manifest-path core/Cargo.toml --no-deps + build: name: Build release binary runs-on: ${{ matrix.os }} diff --git a/core/src/flow.rs b/core/src/flow.rs index 2177d5d..411d53c 100644 --- a/core/src/flow.rs +++ b/core/src/flow.rs @@ -4,20 +4,20 @@ use crate::error::{Result, SteplockError}; #[derive(Debug, Clone)] pub struct FlowGraph { - /// States reachable from [*] (the initial states). + /// States reachable from `[*]` (the initial states). pub initial: Vec, - /// Outgoing transitions per state. States that go to [*] map to vec!["[*]"]. + /// Outgoing transitions per state. States that go to `[*]` map to `vec!["[*]"]`. pub transitions: HashMap>, /// Human-readable label per state. pub labels: HashMap, - /// States with a transition to [*] (terminal states). + /// States with a transition to `[*]` (terminal states). pub terminal: HashSet, /// Topological order of non-pseudo states (for preview output). pub order: Vec, } impl FlowGraph { - /// Returns states that are not yet visited and not the pseudo [*] node. + /// Returns states that are not yet visited and not the pseudo `[*]` node. pub fn pending_after(&self, visited: &[String]) -> Vec { let visited_set: HashSet<&str> = visited.iter().map(|s| s.as_str()).collect(); self.order @@ -27,7 +27,7 @@ impl FlowGraph { .collect() } - /// Outgoing transitions from `state`, excluding [*]. + /// Outgoing transitions from `state`, excluding `[*]`. pub fn next_states(&self, state: &str) -> Vec { self.transitions .get(state) @@ -35,7 +35,7 @@ impl FlowGraph { .unwrap_or_default() } - /// True if `state` is a terminal state (transitions to [*]). + /// True if `state` is a terminal state (transitions to `[*]`). pub fn is_terminal(&self, state: &str) -> bool { self.terminal.contains(state) }