Skip to content

Change Attachment.attach() to Attachment.record() and Attachable.withUnsafeBufferPointer() to Attachable.withUnsafeBytes(). #1032

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 1 commit into from
Mar 20, 2025

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Mar 20, 2025

This PR updates the attach() function to make it static on Attachment and renames it record(), per the discussion here.

It also renames Attachable.withUnsafeBufferPointer() to Attachable.withUnsafeBytes() to more closely match the convention used by the standard library for raw buffers.

Finally, it removes the conditional dependence on the experimental language feature "SuppressedAssociatedTypes" in AttachableContainer.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

….withUnsafeBufferPointer()` to `Attachable.withUnsafeBytes()`.

This PR updates the `attach()` function to make it static on `Attachment` and
renames it `record()`, per the discussion [here](https://forums.swift.org/t/pitch-attachments/78072).

It also renames `Attachable.withUnsafeBufferPointer()` to `Attachable.withUnsafeBytes()`
to more closely match the convention used by the standard library for raw
buffers.

Finally, it removes the conditional dependence on the experimental language
feature "SuppressedAssociatedTypes" in `AttachableContainer`.
@grynspan grynspan added enhancement New feature or request public-api Affects public API attachments/activities 🖇️ Work related to attachments and/or activities labels Mar 20, 2025
@grynspan grynspan added this to the Swift 6.2 milestone Mar 20, 2025
@grynspan grynspan self-assigned this Mar 20, 2025
@grynspan
Copy link
Contributor Author

@swift-ci test

Copy link

@younata younata left a comment

Choose a reason for hiding this comment

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

Thanks for keeping this up to date!

@grynspan grynspan requested a review from stmontgomery March 20, 2025 19:48
@grynspan grynspan merged commit 588807a into main Mar 20, 2025
3 checks passed
@grynspan grynspan deleted the jgrynspan/update-attachment-api branch March 20, 2025 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attachments/activities 🖇️ Work related to attachments and/or activities enhancement New feature or request public-api Affects public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants