#!/usr/bin/env bash
set -e

# Run cargo fmt check on staged files
if ! cargo fmt --all --check 2>/dev/null; then
    echo ""
    echo "ERROR: cargo fmt found formatting issues."
    echo "Run 'cargo fmt --all' to fix them, then stage the changes."
    echo ""
    exit 1
fi
