#!/bin/sh if git diff --cached --name-only --diff-filter=ACM | grep -q '\.rs$'; then if ! cargo fmt --all -- --check; then echo "Error: Unformatted Rust code detected. Run 'cargo fmt'." >&2 exit 1 fi fi exit 0