Skip to content

Simplify CIDR parsing code #4825

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

Merged
merged 2 commits into from
May 20, 2022
Merged

Simplify CIDR parsing code #4825

merged 2 commits into from
May 20, 2022

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented May 20, 2022

This PR simplifies the CIDR parsing code a little bit by passing the CIDR strings one-by-one to the parse_cidr_block() function, instead of passing in the whole Vec. It also refactors parse_cidr_block() to return a Result instead of panicking directly.

/cc @justahero

@Turbo87 Turbo87 added C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labels May 20, 2022
Copy link
Contributor

@justahero justahero left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@Turbo87 Turbo87 merged commit 305df42 into rust-lang:master May 20, 2022
@Turbo87 Turbo87 deleted the simplify-cidr branch May 20, 2022 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants