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
64 changes: 14 additions & 50 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ name: CI

jobs:
rustfmt:
name: Rustfmt
name: "Rustfmt (${{ matrix.crate && matrix.crate || 'base' }})"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: true
matrix:
config:
- { os: ubuntu-latest, target: 'x86_64-unknown-linux-gnu' }
crate: [null, "derive"]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -24,13 +25,14 @@ jobs:
args: --check

clippy:
name: Clippy
name: "Clippy (${{ matrix.crate && matrix.crate || 'base' }})"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, target: 'x86_64-unknown-linux-gnu' }
crate: [null, "derive"]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -41,6 +43,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: clippy
args: ${{ matrix.crate && format(' --manifest-path {0}/Cargo.toml', matrix.crate) }}

test_all:
name: TestAll
Expand All @@ -64,60 +67,21 @@ jobs:
command: test
args: --all-features

test_backends:
name: TestBackends
test_feature_matrix:
name: TestFeatures
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, target: 'x86_64-unknown-linux-gnu' }
- { os: macos-latest, target: 'x86_64-apple-darwin' }
backends: ["syn", ""]

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.config.target }}
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --features "debug_asserts, rustc_hash, generated_setters, debug_diffs, serde, nanoserde, ${{ matrix.backends.target }}"

test_serde:
name: TestSerde
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, target: 'x86_64-unknown-linux-gnu' }
- { os: macos-latest, target: 'x86_64-apple-darwin' }
backend: ["syn", null]
serde: ["nanoserde", "serde", null]
debug_asserts: ["debug_asserts", null]
debug_diffs: ["debug_diffs", null]
hash: ['rustc_hash', null]
generated_setters: ["generated_setters", null]

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.config.target }}
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --features serde

test_setters:
name: TestSetters
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- { os: ubuntu-latest, target: 'x86_64-unknown-linux-gnu' }
- { os: macos-latest, target: 'x86_64-apple-darwin' }

steps:
- uses: actions/checkout@v2
Expand All @@ -129,7 +93,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: --features generated_setters
args: ${{ format('--features "{0}"', join(fromJSON(format('["{0}","{1}","{2}","{3}","{4}","{5}"]', matrix.backend || '', matrix.serde || '', matrix.debug_asserts || '', matrix.debug_diffs || '', matrix.hash || '', matrix.generated_setters || '')), ',')) }}

test_min:
name: TestMin
Expand Down
2 changes: 1 addition & 1 deletion derive/src/difference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ pub(crate) fn derive_struct_diff_enum(enum_: &Enum) -> TokenStream {

let ref_into_owned_body = format!(
"Self::Replace(variant) => {}::Replace(variant.clone()),",
&enum_name
enum_name
);
let struct_generics_names_hash: HashSet<&str> =
enum_.generics.iter().map(|x| x.full()).collect();
Expand Down
2 changes: 1 addition & 1 deletion derive/src/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1141,7 +1141,7 @@ fn next_attributes_list(source: &mut Peekable<impl Iterator<Item = TokenTree>>)

while let Some(attr) = next_attribute(source) {
if let Some(structdiff_attr) = attr {
attributes.extend(structdiff_attr.into_iter());
attributes.extend(structdiff_attr);
}
}

Expand Down
Loading