2

What is the common way to share code between multiple examples defined as part of a Cargo project?

This is my library project:

.
├── Cargo.toml
├── src/
│   └── lib.rs
├── examples/
│   └── example-A/
│   │    └── main.rs
│   └── example-B/
│       └── main.rs

I need to share some code only between example-A and example-B. Where should the shared code live, and how can I refer to it from these two examples?

Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
Nick
  • 10,309
  • 21
  • 97
  • 201
  • Here: https://stackoverflow.com/questions/44539729/what-is-an-idiomatic-way-to-have-shared-utility-functions-for-integration-tests – Fasani Jul 07 '20 at 20:50

0 Answers0