Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add opt-in generic traits for generated SoA types #73

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,22 @@ jobs:
run: cargo test --release
- name: check that benchmarks still compile
run: cargo bench --no-run
tests_derive_generics:
runs-on: ubuntu-20.04
strategy:
matrix:
rust-version: [stable, beta, nightly]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: setup rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust-version }}
- name: run tests in debug mode
run: cargo test -F generic_traits
- name: run tests in release mode
run: cargo test --release -F generic_traits
- name: check that benchmarks still compile
run: cargo bench --no-run -F generic_traits
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Cargo.lock
target
rust-toolchain.toml
29 changes: 3 additions & 26 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,33 +1,10 @@
[package]
name = "soa_derive"
version = "0.13.0"
edition = "2018"
rust-version = "1.63"

authors = ["Guillaume Fraux <[email protected]>"]
license = "MIT/Apache-2.0"
[workspace]

readme = "README.md"
description = "Automatic Struct of Array generation"
repository = "https://github.com/lumol-org/soa-derive"
homepage = "https://github.com/lumol-org/soa-derive"
documentation = "https://docs.rs/soa_derive/"
resolver = "2"

[workspace]
members = [
"soa-derive-internal",
"soa-derive",
"example",
]

[dependencies]
soa_derive_internal = {path = "soa-derive-internal", version = "0.13"}
permutation = "0.4.0"

[dev-dependencies]
bencher = "0.1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"

[[bench]]
name = "soa"
harness = false
2 changes: 1 addition & 1 deletion example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false
edition = "2021"

[dependencies]
soa_derive = {path = ".."}
soa_derive = { path = "../soa-derive", features = []}

[lib]
path = "lib.rs"
3 changes: 3 additions & 0 deletions soa-derive-internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ documentation = "https://docs.rs/soa_derive/"
[lib]
proc-macro = true

[features]
generic_traits = []

[dependencies]
syn = {version = "2", features = ["derive", "extra-traits"]}
quote = "1"
Expand Down
Loading