I'd like to make use of the current crate from an example therein. According to all docs I could find (searching for "example" is meh, btw), this should be straight forward, but I seem to have missed something trivial.
src/main.rs
(crate name xxx
)
pub fn test() {
println!("remote test");
}
fn main() {
println!("Hello, world!");
}
examples/ex.rs
use xxx::test;
pub fn main() {
test();
println!("test");
}
cargo run --example ex
error[E0432]: unresolved import `xxx`
--> examples/ex.rs:1:5
|
1 | use xxx::test;
| ^^^ use of undeclared type or module `xxx`
How can I make the crate visible/addressable to the example code?