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

Update deprecated methods for FromBytes, Ref #1282

Merged
merged 1 commit into from
May 17, 2024
Merged

Conversation

joshlf
Copy link
Member

@joshlf joshlf commented May 17, 2024

  • Rename some non-deprecated FromBytes methods:
    • mut_from -> mut_from_bytes
    • mut_from_with_elems -> mut_from_bytes_with_elems
    • read_from -> read_from_bytes
  • Add missing deprecated Ref methods:
    • new_unaligned
    • new_unaligned_from_prefix
    • new_unaligned_from_suffix
  • In FromBytes, coalesce deprecated methods at the end of the trait
  • Update names in deprecation messages (some names were stale)
  • Make all deprecated methods return Options rather than Results, consistent with their equivalents on 0.7
  • Mark all deprecated methods as #[inline(always)]

Makes progress on #871

- Rename some non-deprecated `FromBytes` methods:
  - `mut_from` -> `mut_from_bytes`
  - `mut_from_with_elems` -> `mut_from_bytes_with_elems`
  - `read_from` -> `read_from_bytes`
- Add missing deprecated `Ref` methods:
  - `new_unaligned`
  - `new_unaligned_from_prefix`
  - `new_unaligned_from_suffix`
- In `FromBytes`, coalesce deprecated methods at the end of the trait
- Update names in deprecation messages (some names were stale)
- Make all deprecated methods return `Option`s rather than `Result`s,
  consistent with their equivalents on 0.7
- Mark all deprecated methods as `#[inline(always)]`

Makes progress on #871
@joshlf joshlf requested a review from jswrenn May 17, 2024 17:54
@joshlf joshlf enabled auto-merge May 17, 2024 17:54
@joshlf joshlf added this pull request to the merge queue May 17, 2024
Merged via the queue into main with commit 36e0a61 May 17, 2024
210 checks passed
@joshlf joshlf deleted the deprecated-ref-methods branch May 17, 2024 18:27
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

2 participants