Skip to content

Migration to v1.1.4

These are the steps to migrate from v1.1.3 to v1.1.4.

Separate formatter check into its own job

Moves the formatter check out of the matrix build to run once.

Add new format-check job

format-check:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v6
    - name: Run formatter check
      if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')
      uses: actions-rust-lang/rustfmt@v1
      with:
        manifest-path: src/Cargo.toml

Remove formatter step from build-and-test

-      - name: Run formatter check
-        uses: actions-rust-lang/rustfmt@v1
-        if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')
-        with:
-          manifest-path: src/Cargo.toml

Update publish-crate

-    needs: [build-and-test, ...]
+    needs: [format-check,build-and-test, ...]

Move semver checks to dedicated job

Replaces the inline semver check with a dedicated job using the devops-cargo-semver-checks-action.

Remove inline semver check from build-and-test

Remove the step from build-and-test:

-      # Note: The GitHub Runner Images will contain an up to date Rust Stable Toolchain
-      #       thus as per recommendation of cargo-semver-checks, we're using stable here.
-      #
-      # Note to reader. If adding this to a new repo, please clear cache.
-      - name: Run cargo-semver-checks
-        if: (github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')) && !matrix.use-cross
-        working-directory: src
-        shell: bash
-        run: |
-          SEARCH_RESULT=$(cargo search "^{{project-name}}$" --limit 1)
-
-          if echo "$SEARCH_RESULT" | grep -q "^{{project-name}} "; then
-              # Run semver checks on stable, because nightly sometimes gets borked in cargo-semver-checks.
-              rustup +stable target add ${{ matrix.target }}
-              # Note: binstall is available after devops-rust-test-and-coverage@v1 call
-              cargo +stable binstall --no-confirm cargo-semver-checks --force
-              cargo +stable semver-checks --target ${{ matrix.target }} {% if build_c_libs %}--features c-exports{% endif %}
-          else
-              echo "No previous version found on crates.io. Skipping semver checks."
-          fi

Add new semver-checks job

Add after format-check:

  semver-checks:
    runs-on: ubuntu-latest
    if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/tags/')
    steps:
      - name: Run semver check
        uses: Reloaded-Project/devops-cargo-semver-checks-action@v1
        with:
          manifest-path: src/Cargo.toml
          feature-group: all-features
          rust-toolchain: stable
          rust-target: x86_64-unknown-linux-gnu

The action checks all published crates in the workspace (skips unpublished with skip-unpublished: true default).

Update publish-crate needs

-    needs: [format-check,build-and-test, ...]
+    needs: [format-check,semver-checks,build-and-test, ...]

Simplify src/AGENTS.md and split review guidance files

Replaces the monolithic src/AGENTS.md with a minimal version that references new review-only guidance files.

Update src/AGENTS.md

-# {{project-name}}
-
-{{project_description}}
-
-# Layout
-...
+After changes, run `.cargo/verify.{sh,ps1}` before returning.
+If relevant to your review task, read `.cargo/{general,performance,documentation}.md`.
+Prefer `-` over `—`. Preserve user comments, update if inaccurate.

Create src/.cargo/general.md

# General Rules

- Keep modules under 500 lines excluding tests.
- Place `use` inside functions only for `#[cfg]` conditional compilation.

Create src/.cargo/performance.md

# Performance Rules

## Memory and allocation

- Preallocate collections when size is known or estimable:
  - `String::with_capacity(estimated_len)`
  - `Vec::with_capacity(count)`
  - `BufReader::with_capacity(size, reader)`
- Prefer `&str` / `&[T]` returns over owned types when lifetime allows.
- Use `Cow<'_, str>` for conditional ownership such as `String::from_utf8_lossy`.
- Use `&'static str` for compile-time constant strings.
- Reuse buffers with `.clear()` instead of reallocating.

## Zero-cost abstractions

- Use const generics for compile-time branching such as `<const LINE_NUMBERS: bool>`.
- Use `#[inline]` on small hot-path functions.
- Prefer `core` over `std` where possible.
- Stream data instead of loading entire files when possible.

## Dependencies

- Prefer performance-oriented crates such as `parking_lot` and `memchr`.
- Keep dependency footprint minimal.

Create src/.cargo/documentation.md

# Documentation Rules

- Document public items with `///`.
- Add examples in docs where helpful.
- Use `//!` for module-level docs.
- Focus comments on why, not what.
- Use [`TypeName`] rustdoc links instead of backticks.

Add local-reviews to .gitignore

Add to .gitignore:

+# Local Code Review
+src/.vscode/local-reviews/

Update src/.cargo/verify.sh and src/.cargo/verify.ps1 headers

Add clarifying comments to both verify scripts:

  # Post-change verification script
  # All steps must pass without warnings
  # Keep in sync with verify.ps1
+# Script is relative to git repo root; search if not found
  # Post-change verification script
  # All steps must pass without warnings
  # Keep in sync with verify.sh
+# Script is relative to git repo root; search if not found

Update template version marker

- reloaded-templates-rust:1.1.3
+ reloaded-templates-rust:1.1.4