Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt

- name: Check format
run: cargo +nightly fmt --check

clippy:
name: Clippy
needs: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@1.77.0
with:
components: clippy

- name: Run clippy
run: cargo clippy --tests
env:
RUSTFLAGS: -D warnings

tests:
name: Tests
needs: clippy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@1.77.0

- name: Run tests
run: cargo test
75 changes: 0 additions & 75 deletions .github/workflows/main.yaml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish

on:
push:
tags:
- "*"

jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable

- name: Run tests
run: cargo test

publish:
name: Publish
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable

- name: Cargo publish
run: cargo publish --token ${{ secrets.CRATES_IO_TOKEN }}
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[package]
name = "transitive"
version = "1.1.0"
version = "1.2.0"
edition = "2021"
rust-version = "1.77.0"
authors = ["bobozaur"]
description = "Transitive derive macros for Rust."
license = "MIT"
Expand Down
1 change: 0 additions & 1 deletion tests/combined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ mod macros;
use transitive::Transitive;

#[derive(Transitive)]
#[allow(clippy::duplicated_attributes)]
#[transitive(from(D, C, B), from(C, B))] // impl From<D>for A and impl From<C> for A
#[transitive(try_into(B, C, D))] // impl TryFrom<A> for D
struct A;
Expand Down
1 change: 0 additions & 1 deletion tests/from.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ impl_from!(B to A);
impl_from!(C to B);
impl_from!(D to C);

#[allow(clippy::duplicated_attributes)]
#[derive(Transitive)]
#[transitive(from(D, C, B, A))] // impl From<D> for Z<T>
#[transitive(from(C, B))] // impl From<C> for Z<T>
Expand Down
Loading