docs: document Cargo.toml features - #387
Conversation
Add serde-style comments describing each optional feature so users can see what serde, ndarray-bindings, datasets, std_rand, and js enable without reading the source.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## development #387 +/- ##
===============================================
- Coverage 45.59% 44.07% -1.53%
===============================================
Files 93 95 +2
Lines 8034 8055 +21
===============================================
- Hits 3663 3550 -113
- Misses 4371 4505 +134 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Overall AssessmentThe PR is well-scoped and correct — it directly addresses issue #68 with no behavioral changes. The diff is minimal and the added comments are accurate and useful. It's ready to merge with one minor suggestion. What's Good
Minor SuggestionsA few small improvements worth considering before merging:
Suggested Review CommentYou could add an inline suggestion on the # No features enabled by default; keeps the build WASM-compatible
# and avoids pulling in serde/rand unless explicitly requested.
default = []The PR is otherwise approved — it's a low-risk, high-value documentation improvement that will directly benefit new contributors trying to understand feature flags without reading source code. |
Problem
Optional features in
Cargo.tomlhad little or no description, so users had to dig through source or README to learn what each flag enables. Issue #68 asked for serde-style feature documentation, including the missingserdefeature note.Change
Document every feature in
Cargo.tomlwith short comments in the style of serde's Cargo.toml:default- empty (WASM-friendly defaults)serde- Serialize/Deserialize for models; enables typetag on non-wasmndarray-bindings- optional ndarray DenseMatrix bindingsdatasets- sample datasets and generators (pulls instd_rand+serde)std_rand- StdRng / thread_rng instead of SmallRngjs- getrandom wasm_js backend for browser buildsFeature names were checked against
cfg(feature = ...)usage in the crate (serde,datasets,ndarray-bindings,std_rand,js).Test plan
cargo metadata --no-depsparses features successfullyFixes #68