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 some more methods and functions const #690

Merged
merged 2 commits into from
Sep 2, 2022
Merged

Conversation

jamwaffles
Copy link
Member

@jamwaffles jamwaffles commented Sep 1, 2022

Thank you for helping out with embedded-graphics development! Please:

  • Check that you've added passing tests and documentation
  • Add a CHANGELOG.md entry in the Unreleased section under the appropriate heading (Added, Fixed, etc) if your changes affect the public API
  • Run rustfmt on the project
  • Run just build (Linux/macOS only) and make sure it passes. If you use Windows, check that CI passes once you've opened the PR.

PR description

A pass of #![warn(clippy::missing_const_for_fn)] + cargo clippy.

Doesn't do as much as I had hoped, but we still get some nice improvements. Notably, PrimitiveStyleBuilder is now completely const which is great.

Closes #674

TODO

  • Tease out public const-ifications for changelog entry.

src/image/image_raw.rs Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
@jamwaffles jamwaffles marked this pull request as ready for review September 2, 2022 17:51
@jamwaffles jamwaffles force-pushed the more-const-fn branch 2 times, most recently from 53b38c6 to 7650738 Compare September 2, 2022 18:06
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@rfuest rfuest left a comment

Choose a reason for hiding this comment

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

LGTM. Constant text and primitive styles are really nice to have.

@jamwaffles jamwaffles merged commit e2eb49c into master Sep 2, 2022
@jamwaffles jamwaffles deleted the more-const-fn branch September 2, 2022 18:14
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.

Look into more const generics stuff with Rust 1.61
2 participants