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

feat: remove unsafe fn from construction of combiners #18

Closed
wants to merge 1 commit into from

Conversation

robjtede
Copy link
Contributor

Motivation

IpCidrCombiner is not unsafe, in that contains no unsafe blocks or calls to other unsafe functions. Upholding logic requirements with unsafe is considered a misuse.

It's a shame that downstream #[forbid(unsafe)] crates can't use these constructors.

Proposal

Remove the unsafe declarations for these _unchecked functions and detail in the documentation what the logic requirements are for the arguments. (I haven't been able to figure out exactly what these requirements are from reading push since there's no comments explaining what's going on.)

Also introduce constructors that use push internally for cases where the caller cannot guarantee the logic requirements.

Interested on your thoughts on this.

@robjtede robjtede closed this Dec 27, 2023
@robjtede robjtede deleted the rm-unsafe branch December 27, 2023 00:22
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

1 participant