Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1265c2c

Browse files
authored
feat(string_wizard): add serde feature (#3140)
When `string_wizard` is used inside `oxc`, and with `oxc_index` having the `serde` feature enabled, feature unification breaks apart. And there is no way to force enable a dependencie's dependency's feature. This is the last resort :-( ``` error[E0433]: failed to resolve: use of undeclared crate or module `serde` --> crates/string_wizard/src/chunk.rs:5:1 | 5 | / oxc_index::define_index_type! { 6 | | pub struct ChunkIdx = u32; 7 | | } | |_^ use of undeclared crate or module `serde` | = note: this error originates in the macro `$crate::__internal_maybe_index_impl_serde` which comes from the expansion of the macro `oxc_index::define_index_type` (in Nightly builds, run with -Z macro-backtrace for more info) ```
1 parent 7fe1cd0 commit 1265c2c

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/string_wizard/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,15 @@ version = "0.0.24"
1111
oxc_index = { workspace = true }
1212
oxc_sourcemap = { workspace = true, optional = true }
1313
rustc-hash = { workspace = true }
14+
serde = { workspace = true, optional = true }
1415

1516
[dev-dependencies]
1617
insta = { workspace = true }
1718

1819
[features]
1920
default = ["sourcemap"]
21+
serde = ["dep:serde", "oxc_index/serde"]
2022
sourcemap = ["dep:oxc_sourcemap"]
23+
24+
[package.metadata.cargo-shear]
25+
ignored = ["serde"]

0 commit comments

Comments
 (0)