From f427b0bf13480d3ef226b2b287ff2ea6769c0172 Mon Sep 17 00:00:00 2001 From: Tom Anderson Date: Mon, 11 Nov 2024 20:49:13 +1100 Subject: [PATCH] add simple ci --- .github/workflows/checks.yml | 35 +++++++++++++++++++++++++++++++++++ README.md | 14 +++++++------- 2 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/checks.yml diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..c23d7ab --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,35 @@ +name: checks + +on: push + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: "-Dwarnings" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} + - uses: dtolnay/rust-toolchain@stable + - name: Build + run: cargo build + - name: Clippy + run: cargo clippy + - name: Test + run: cargo test + - name: Check Examples + run: cargo check --examples diff --git a/README.md b/README.md index 71f1cc5..78b9efe 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,10 @@ Append a type to a tuple. ```rust -assert_type_eq_all!( - <(usize, char) as Append>::Append, +static_assertions::assert_type_eq_all!( + <(usize, char) as tuple_traits::Append>::Append, (usize, char, bool) -) +); ``` ## [`Cons`](https://docs.rs/tuple-traits/latest/tuple-traits/trait.Cons.html) @@ -26,8 +26,8 @@ Represent a tuple as a cons (*ish*) value, with the first value on the left, and tuple on the right. ```rust -assert_impl_all!( - (usize, usize, usize): Cons +static_assertions::assert_impl_all!( + (usize, usize, usize): tuple_traits::Cons ); ``` @@ -42,7 +42,7 @@ struct C; fn requires_c(value: T) where - T: Contains + T: tuple_traits::Contains { } @@ -50,7 +50,7 @@ where requires_c((A, B, C)); // Compiler error: `C` does not appear within `(A, B)` -requires_c((A, B)); +// requires_c((A, B)); ``` # Example