From 2919d7d1b0ccf7cce7f415c9e70b8cc1a077c285 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Sun, 25 Oct 2026 14:07:30 +0100 Subject: [PATCH] Check the formatting of every crate outside the workspace --- .github/workflows/ci.yml | 6 ++++++ examples/support/src/text.rs | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f528d99..b946e67 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,12 @@ jobs: - uses: actions/checkout@v7 - run: rustup toolchain install stable --profile minimal --component rustfmt - run: cargo +stable fmt --check + # The examples and probes are crates of their own. The web probe's manifest needs nightly, and its job checks it. + - name: Crates outside the workspace + run: | + for manifest in $(git ls-files '*/Cargo.toml' | grep -v -e '^pushups-macros/' -e '^ci/web/probe/'); do + cargo +stable fmt --check --manifest-path "$manifest" + done # The Android module's version, which the runtime handshake compares, follows the crate's. - run: ci/check-versions.sh diff --git a/examples/support/src/text.rs b/examples/support/src/text.rs index 55ef24f..5a8cdfb 100644 --- a/examples/support/src/text.rs +++ b/examples/support/src/text.rs @@ -56,7 +56,10 @@ pub fn draw<'line>( let left = frame.insets.left + 2 * glyph; let top = frame.insets.top + 2 * glyph; let bottom = frame.height.saturating_sub(frame.insets.bottom + 2 * glyph); - let columns = frame.width.saturating_sub(left + frame.insets.right + 2 * glyph) / glyph; + let columns = frame + .width + .saturating_sub(left + frame.insets.right + 2 * glyph) + / glyph; if columns == 0 { return; }