Migration to v1.4.2
From v1.4.1 to v1.4.2.
Slims the LLM guidance and moves core-over-std to a Clippy lint:
- Deletes the
.llm/{general,performance,documentation}.mdguidance files. - Inlines the performance reminders into
src/AGENTS.md. - Runs rust-llm-tidy at the end of
.llm/verify.{sh,ps1}when installed. - Adds the
std_instead_of_coreClippy lint to the workspace.
1. Delete the guidance files
src/.llm/documentation.md
src/.llm/general.md
src/.llm/performance.md
2. Replace src/AGENTS.md
After changes, find and run `.llm/verify.{sh,ps1}` to test + lint.
Print all output.
Performance:
- Prefer borrows: `&str` / `&[T]` returns, `&'static str` constants,
`Cow<'_, str>` for conditional ownership.
- `Box<str>` for immutable strings.
- Reuse buffers via `.clear()`.
- Const generics for compile-time branching such as
`<const LINE_NUMBERS: bool>`.
- Prefer performance-oriented crates such as `parking_lot` and `memchr`.
- Keep dependency footprint minimal.
3. Add the tidy step to the verify scripts
In .llm/verify.sh, after the publish dry-run:
echo "Publish dry-run..."
run_cmd cargo publish --dry-run --allow-dirty --quiet --workspace
+
+echo "Tidy..."
+if command -v rust-llm-tidy >/dev/null 2>&1; then
+ run_cmd rust-llm-tidy
+else
+ echo "Skipping; rust-llm-tidy not installed. Install: cargo install rust-llm-tidy-cli"
+fi
if [ "$EXIT_CODE" -eq 0 ]; then
In .llm/verify.ps1, after the publish dry-run:
Write-Host "Publish dry-run..."
Invoke-LoggedCommand "cargo" @("publish", "--dry-run", "--allow-dirty", "--quiet", "--workspace")
+
+ Write-Host "Tidy..."
+ if (Get-Command rust-llm-tidy -ErrorAction SilentlyContinue) {
+ Invoke-LoggedCommand "rust-llm-tidy" @()
+ } else {
+ Write-Host "Skipping; rust-llm-tidy not installed. Install: cargo install rust-llm-tidy-cli"
+ }
} finally {
4. Add the Clippy lint
Root Cargo.toml:
[workspace]
resolver = "2"
members = ["src/my-project"]
+
+# Inherited by members via `[lints] workspace = true`.
+[workspace.lints.clippy]
+# Prefer `core` over `std` where both work.
+std_instead_of_core = "warn"
Every member crate (src/my-project/Cargo.toml, src/cli/Cargo.toml if present):
# categories = ["command-line-utilities"]
+
+[lints]
+workspace = true
Then fix any hits, for example the benchmark:
-use std::hint::black_box;
+use core::hint::black_box;
5. Update the template version marker
-reloaded-templates-rust:1.4.1
+reloaded-templates-rust:1.4.2