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

Simplify OptionalWrapper #344

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Simplify OptionalWrapper #344

wants to merge 1 commit into from

Conversation

Nahor
Copy link
Contributor

@Nahor Nahor commented Feb 17, 2024

  1. That commit is based on Label collection fixes and cleanup #343 to avoid conflicts. But Github doesn't supports stacked PR across forks, so for now, it includes Label collection fixes and cleanup #343 as well. Just look at the last commit for the actual change.

  2. I'm new to Rust and there are sometimes subtilties that escape me. So maybe it's not quite identical code. All the unit tests pass at least.

  3. I don't know how you feel about minor changes like that. I would totally understand if you think it's a pointless/unnecessary one.

@zkat
Copy link
Owner

zkat commented Feb 17, 2024

Don't worry, you're doing great.

Usually, I wouldn't want to make low-value changes that break public APIs, but I don't think macro_helpers really counts as a public API per se, so I'm fine with it in this case. I'll just handwave and pretend it's not public :P

- We never use `self`, so there is no need to pass it as a parameter...
- ... which then removes the need to instanciate the wrapper with `new`
- There is no reason to expect other type than `Option` so we can contrain
  the trait to the type directly instead of using the `IsOption` trait
@Nahor Nahor marked this pull request as ready for review February 21, 2024 20:49
@zkat
Copy link
Owner

zkat commented Feb 29, 2024

On second thought, I'll keep this around as a breaking change for next time we do a semver-major.

@zkat zkat added the breaking A semver-major breaking change label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A semver-major breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants