Tool to recursively find Cargo.toml files and update the rust-version value to the latest installed Rust.
Zig 100.0%
7 1 0

Clone this repository

https://tangled.org/m17e.co/rv https://tangled.org/did:plc:2f7mndshqqlmdmjypop4p6oy/rv
git@tangled.org:m17e.co/rv git@tangled.org:did:plc:2f7mndshqqlmdmjypop4p6oy/rv

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

rust-version-updater#

A fast CLI tool written in Zig that recursively updates rust-version fields in Cargo.toml files to match your currently installed Rust version.

Why?#

Rust's rust-version field in Cargo.toml specifies the minimum Rust version required to build a crate. Keeping this field updated across multiple crates in a workspace or monorepo can be tedious. This tool automates that process.

Features#

  • Recursively scans directories for Cargo.toml files
  • Only updates versions that are older than your current rustc version
  • Skips workspace inheritance (rust-version = { workspace = true })
  • Dry-run mode to preview changes before applying
  • Single static binary with no runtime dependencies

Installation#

From source#

This project follows Zig master (currently 0.16.0-dev.2962+08416b44f):

zig build -Doptimize=ReleaseFast

The binary will be in zig-out/bin/rust-version-updater.

Usage#

# Update all Cargo.toml files in current directory tree
rust-version-updater

# Preview changes without modifying files
rust-version-updater --dry-run

# Show help
rust-version-updater --help

Example output#

Current Rust version: 1.84.0

src/foo/Cargo.toml: updated 1.70.0 -> 1.84.0
src/bar/Cargo.toml: skipped (version 1.84.0 is not older)
src/baz/Cargo.toml: skipped (non-semver value)

--- Summary ---
Files scanned: 3
Files updated: 1
Files skipped: 2
Errors: 0

License#

MIT