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

Make the examples runnable by cargo. #6

Merged
merged 1 commit into from
May 10, 2019

Conversation

Fraser999
Copy link
Contributor

This allows us to run the examples by calling e.g.
'cargo run --example hello_world'

It also means the examples get compiled when calling 'cargo test'.

Copy link
Owner

@seladb seladb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I wrote these examples I debated between writing them as separate applications (with different TOMLs) and writing them as rs files that are being built together with the library.

I chose the first option because I think it's cleaner and it also gives the user a real example app that uses the library

@seladb
Copy link
Owner

seladb commented May 10, 2019

The subsequent PRs rely on these changes so let's sort this one out first and then I'll review the other ones

This allows us to run the examples by calling e.g.
'cargo run --example hello_world'

It also means the examples get compiled when calling 'cargo test'.
@Fraser999
Copy link
Contributor Author

I updated this to retain your preferred project structure, but still to allow the expected cargo run --example ... to work.

@seladb seladb merged commit 172a0e1 into seladb:master May 10, 2019
@Fraser999 Fraser999 deleted the move_examples branch May 10, 2019 23:31
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

Successfully merging this pull request may close these issues.

None yet

2 participants