#!/bin/bash
set -euo pipefail
set -x

cargo clippy --all-targets --all-features "$@" -- -D warnings

if [ $# -gt 0 ] && [ "$1" = "--fix" ]
then
  cargo fmt --all
else
  cargo fmt --all -- --check
fi

