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

export IpNumber #52

Closed
wants to merge 1 commit into from
Closed

export IpNumber #52

wants to merge 1 commit into from

Conversation

ssrlive
Copy link
Contributor

@ssrlive ssrlive commented Sep 29, 2024

No description provided.

@SajjadPourali
Copy link
Collaborator

I believe exporting IpNumber should be avoided, as it forces developers to import the entire etherparse package whenever they need it. Additionally, it can lead to dependency version mismatches, which have occurred before (see issue #50).

@ssrlive ssrlive closed this by deleting the head repository Sep 30, 2024
@ssrlive
Copy link
Contributor Author

ssrlive commented Sep 30, 2024

I have tested, the issue can be resolved by this

etherparse::IpNumber(u.ip_protocol().0) == etherparse::IpNumber(1)

or

u.ip_protocol() == ipstack::IpNumber(1)

and the first point, Since the etherparse is used by ipstack, so a special version of etherparse will always exist in Cargo.lock of user's project.

The advantage of exporting IpNumber directly is that when we need to use a method of IpNumber in another project, we can call it directly without importing the etherparse crate again.

If it makes sense to you, I‘m grad to restore this PR.

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