Skip to content

Commit 8b27764

Browse files
Nemo157nyurik
andauthored
fix: correctly feature gate default features (#53)
Without this `cargo check --no-default-features` fails because of missing `serde`. --------- Signed-off-by: Wim Looman <[email protected]> Co-authored-by: Yuri Astrakhan <[email protected]>
1 parent 96b4265 commit 8b27764

File tree

4 files changed

+110
-69
lines changed

4 files changed

+110
-69
lines changed

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ categories = ["embedded", "no-std", "encoding", "parsing"]
1010
edition = "2021"
1111
rust-version = "1.74"
1212

13+
[[example]]
14+
name = "file_parser"
15+
path = "examples/file_parser.rs"
16+
required-features = ["encodings"]
17+
1318
[features]
14-
default = ["with-serde", "encodings"]
19+
default = ["serde", "encodings"]
1520
# Support decoding from all standard encodings, e.g. cp1251 commonly used for dbc
1621
encodings = ["dep:encoding_rs"]
1722
serde = ["dep:serde"]

justfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ build-diagram:
3535
# Quick compile without building a binary
3636
check:
3737
cargo check {{packages}} {{features}} {{targets}}
38+
cargo check {{packages}} --no-default-features {{targets}}
3839

3940
# Generate code coverage report to upload to codecov.io
4041
ci-coverage: env-info && \
@@ -43,7 +44,7 @@ ci-coverage: env-info && \
4344
mkdir -p target/llvm-cov
4445

4546
# Run all tests as expected by CI
46-
ci-test: env-info test-fmt clippy test test-doc deny && assert-git-is-clean
47+
ci-test: env-info test-fmt check clippy test test-doc deny && assert-git-is-clean
4748

4849
# Run minimal subset of tests to ensure compatibility with MSRV
4950
ci-test-msrv: env-info check test

0 commit comments

Comments
 (0)