#!/usr/bin/env bash

set -eu

if ! cargo fmt --all -- --check
then
    echo "There are some code style issues."
    echo "Run cargo fmt first."
    exit 1
fi

if ! cargo clippy --all-targets --all-features --tests -- -D warnings 
then
    echo "There are some clippy issues."
    exit 1
fi

if ! cargo test --all-features
then
    echo "There are some test issues."
    exit 1
fi

exit 0
