Skip to content

Commit

Permalink
add simple ci
Browse files Browse the repository at this point in the history
  • Loading branch information
andogq committed Nov 11, 2024
1 parent a5d4808 commit f427b0b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 7 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
Append a type to a tuple.

```rust
assert_type_eq_all!(
<(usize, char) as Append>::Append<bool>,
static_assertions::assert_type_eq_all!(
<(usize, char) as tuple_traits::Append>::Append<bool>,
(usize, char, bool)
)
);
```

## [`Cons`](https://docs.rs/tuple-traits/latest/tuple-traits/trait.Cons.html)
Expand All @@ -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<Left = usize, Right = (usize, usize)>
static_assertions::assert_impl_all!(
(usize, usize, usize): tuple_traits::Cons<Left = usize, Right = (usize, usize)>
);
```

Expand All @@ -42,15 +42,15 @@ struct C;

fn requires_c<T, Index>(value: T)
where
T: Contains<C, Index>
T: tuple_traits::Contains<C, Index>
{
}

// Works!
requires_c((A, B, C));

// Compiler error: `C` does not appear within `(A, B)`
requires_c((A, B));
// requires_c((A, B));
```

# Example
Expand Down

0 comments on commit f427b0b

Please sign in to comment.