Skip to content

Make examples recognized by cargo #223

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

Closed
wants to merge 6 commits into from

Conversation

SkiFire13
Copy link

#222 fixed the imports in the examples, however it didn't actually fix CI. The reason is that cargo doesn't recognize crate examples, only single files or a main.rs inside a single folder (not nested like in a crate). This PR fixes this by changing the file structure in such a way that cargo recognized them. Note that:

  • I cargo fmts the examples because now that cargo can see them it can also format them. This wasn't the case before.
  • I removed the cargo check --examples from CI because it is redundant: cargo test already checks them, but both commands require the file structure to be correct.
  • I also updated the examples to use ConfigBuilder in order to fix the warnings. This might need some feedback here since I'm not 100% this is right.
  • The config position relative to the main.rs is not accurate anymore unfortunately.

@matthiasbeyer
Copy link
Member

Grml... I should've checked this more carefully! Thanks a lot for fixing this up!

@SkiFire13
Copy link
Author

I've removed those #[allow(deprecated)], and although I don't really like the end result I don't think there are better ways with the current state of the crate.

@matthiasbeyer
Copy link
Member

Superceeded by #253

@SkiFire13 SkiFire13 deleted the fix-examples branch December 28, 2021 20: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.

2 participants