this post was submitted on 17 Nov 2023
17 points (94.7% liked)
Rust
5999 readers
21 users here now
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Wormhole
Credits
- The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Thanks for the great points.
I'm glad my points we're helpful!
There is some documentation on examples in the Cargo book. The basic procedure is to put it in an
examples
directory alongside thesrc
directory (and in its own subfolder if it has multiple files), and you can add an entry for it in theCargo.toml
(although it should automatically detect it if you put it in theexamples
directory, so that is only strictly necessary if you want to change the default settings).Yeah I moved it over and it got a lot nicer, nice to have this type of thing built in to cargo.