smart-string 0.3.0

A collection of string types and traits designed for enhanced string manipulation.
Documentation
#!/usr/bin/env bash
set -euo pipefail

# Library repositories must not commit Cargo.lock.
if git diff --cached --name-only | grep -Eq '(^|/)Cargo\.lock$'; then
  echo "error: Cargo.lock must not be committed in library repositories (it should be gitignored)." >&2
  exit 1
fi

# Only run heavy checks if Rust source files are staged.
if ! git diff --cached --name-only | grep -qE '\.rs$|Cargo\.toml$'; then
  exit 0
fi

# Format check (nightly rustfmt).
if rustup run nightly rustfmt --version >/dev/null 2>&1; then
  echo "pre-commit: checking formatting..."
  cargo +nightly fmt --all -- --check
fi

# Clippy (stable, deny warnings).
echo "pre-commit: running clippy..."
cargo clippy --all-targets -- -D warnings