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

refactor(pmtud): implement Copy for Probe #26

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

mxinden
Copy link

@mxinden mxinden commented Jul 10, 2024

Nit pick:

Probe is a small simple enum on the stack, thus convention is to implement Copy instead of only Clone with a call to clone().

The following helped me in the past:

When should my type be Copy?

Generally speaking, if your type can implement Copy, it should. Keep in mind,
though, that implementing Copy is part of the public API of your type. If the
type might become non-Copy in the future, it could be prudent to omit the Copy
implementation now, to avoid a breaking API change.

https://doc.rust-lang.org/std/marker/trait.Copy.html#when-should-my-type-be-copy

`Probe` is a small simple enum on the stack, thus convention is to implement
`Copy` instead of only `Clone` with a call to `clone()`.

The following helped me in the past:

> When should my type be Copy?
>
> Generally speaking, if your type can implement Copy, it should. Keep in mind,
> though, that implementing Copy is part of the public API of your type. If the
> type might become non-Copy in the future, it could be prudent to omit the Copy
> implementation now, to avoid a breaking API change.

https://doc.rust-lang.org/std/marker/trait.Copy.html#when-should-my-type-be-copy
@mxinden mxinden requested a review from larseggert as a code owner July 10, 2024 13:28
@larseggert larseggert merged commit 2ce8db1 into larseggert:feat-dplpmtud Jul 10, 2024
1 of 2 checks passed
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