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

[FromBytes] Rename some methods for consistency #1210

Merged
merged 1 commit into from
May 7, 2024

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented May 7, 2024

Add ref_ prefix to from_{prefix,suffix}_with_trailing_elements to be consistent with other methods.

Makes progress on #871

@joshlf joshlf requested a review from jswrenn May 7, 2024 16:17
@joshlf joshlf enabled auto-merge May 7, 2024 16:17
@joshlf joshlf mentioned this pull request May 7, 2024
13 tasks
auto-merge was automatically disabled May 7, 2024 16:23

Pull Request is not mergeable

@joshlf joshlf force-pushed the from-bytes-method-names branch from e9b416b to b3c3943 Compare May 7, 2024 16:28
@joshlf joshlf enabled auto-merge May 7, 2024 16:28
src/lib.rs Outdated
@@ -2463,7 +2463,7 @@ pub unsafe trait FromBytes: FromZeros {
where
Self: Sized + Immutable,
{
<[Self]>::from_prefix_with_trailing_elements(bytes, count).ok()
<[Self]>::ref_from_prefix_with_trailing_elements(bytes, count).ok()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Whoa, what's up with this function signature? This should call mut_from_prefix_with_trailing_elements, and the fact that we're not points to a bug in the signature itself. This should be returning &mut [Self]s.

Copy link
Member Author

Choose a reason for hiding this comment

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

Wow yeah must have been a copy+paste error at some point. Fixed.

Add `ref_` prefix to `from_{prefix,suffix}_with_trailing_elements` to be
consistent with other methods.

Makes progress on #871
@joshlf joshlf force-pushed the from-bytes-method-names branch from b3c3943 to 5baa241 Compare May 7, 2024 17:18
@joshlf joshlf requested a review from jswrenn May 7, 2024 17:18
@joshlf joshlf added this pull request to the merge queue May 7, 2024
Merged via the queue into main with commit f405033 May 7, 2024
210 checks passed
@joshlf joshlf deleted the from-bytes-method-names branch May 7, 2024 17:34
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