Move Rust examples into their crates so cargo publish picks them up

The previous `[[example]] path = "../../examples/rust/..."` entries
pointed at files outside the crate root. cargo only packages files
inside the crate directory, so the examples would have been silently
dropped on publish. Moving them to crates/wickra/examples/ and
crates/wickra-data/examples/ keeps them as part of the published
package and lets cargo discover them automatically (no [[example]]
override needed). README and project-layout section updated.
This commit is contained in:
kingchenc
2026-05-21 20:36:57 +02:00
parent 1295b63e1f
commit 06f67c8c0e
5 changed files with 3 additions and 9 deletions
+3 -3
View File
@@ -109,7 +109,7 @@ inherit it automatically.
| Python (PyO3) | `pip install wickra` | `examples/python/backtest.py` |
| Node.js (napi-rs) | `npm install wickra` | `bindings/node/__tests__/smoke.test.js` |
| Browser / WASM | `npm install wickra-wasm` | `bindings/wasm/examples/index.html` |
| Rust | `cargo add wickra` | `examples/rust/backtest.rs` |
| Rust | `cargo add wickra` | `crates/wickra/examples/backtest.rs` |
The wickra-core crate is `unsafe`-forbidden, so every binding inherits a
memory-safe implementation.
@@ -175,8 +175,8 @@ wickra/
│ ├── node/ napi-rs (publishes on npm)
│ └── wasm/ wasm-bindgen (browsers, bundlers, Node)
├── examples/
── python/ backtest, live trading, parallel assets, multi-tf
└── rust/ backtest, live Binance
── python/ backtest, live trading, parallel assets, multi-tf
(Rust examples live inside their crate at crates/<name>/examples/)
├── benches/ cargo bench targets
└── .github/workflows/ CI and release pipelines
```
-1
View File
@@ -41,5 +41,4 @@ tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
[[example]]
name = "live_binance"
path = "../../examples/rust/live_binance.rs"
required-features = ["live-binance"]
-5
View File
@@ -31,8 +31,3 @@ wickra-data = { path = "../wickra-data" }
[[bench]]
name = "indicators"
harness = false
[[example]]
name = "backtest"
path = "../../examples/rust/backtest.rs"
required-features = []