Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proivde easy way to build examples #30

Open
marcmo opened this issue Jan 31, 2025 · 0 comments
Open

Proivde easy way to build examples #30

marcmo opened this issue Jan 31, 2025 · 0 comments
Assignees

Comments

@marcmo
Copy link
Member

marcmo commented Jan 31, 2025

using this structure:

my_library/
├── src/
│   ├── lib.rs  # Your library code
│   ├── some_module.rs
├── examples/
│   ├── example1.rs  # Example showcasing some feature
│   ├── example2.rs  # Another example
├── tests/  # Integration tests (optional)
│   ├── integration_test.rs
├── Cargo.toml

Cargo.toml might look s.th. like this:

[package]
name = "my_library"
version = "0.1.0"
edition = "2021"

[dependencies]
# Add your dependencies here

[[example]]
name = "example1"
path = "examples/example1.rs"

[[example]]
name = "example2"
path = "examples/example2.rs"

then the examples can be built and run with cargo:
cargo run --example example1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants