Skip to content

refactor: seal DeviceId, use impl AsRef<str> in builder, and box frozen slice fields#1210

Merged
roderickvd merged 2 commits into
masterfrom
refactor/seal-box-and-arc
May 19, 2026
Merged

refactor: seal DeviceId, use impl AsRef<str> in builder, and box frozen slice fields#1210
roderickvd merged 2 commits into
masterfrom
refactor/seal-box-and-arc

Conversation

@roderickvd
Copy link
Copy Markdown
Member

Some refactoring for efficiency, clearer intent, and foot-shooting prevention.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors device identifiers and device-description storage/API to reduce exposed structure and avoid unnecessary vector capacity in frozen metadata.

Changes:

  • Makes DeviceId opaque with constructor/accessor methods and updates backend call sites.
  • Changes DeviceDescription::extended() to return &str iterator and boxes immutable slice fields.
  • Updates changelog/upgrading documentation for the breaking API changes.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
UPGRADING.md Documents DeviceId and extended-description migration steps.
CHANGELOG.md Adds breaking-change notes for DeviceId and DeviceDescription APIs.
src/lib.rs Seals DeviceId fields and adds constructor/accessors.
src/device_description.rs Boxes extended descriptions and changes builder/string APIs.
src/host/aaudio/mod.rs Updates AAudio descriptions and DeviceId creation.
src/host/aaudio/java_interface/definitions.rs Stores Java device metadata arrays as boxed slices.
src/host/aaudio/java_interface/devices_info.rs Converts Java metadata vectors into boxed slices.
src/host/alsa/mod.rs Updates ALSA DeviceId/description builder usage.
src/host/alsa/enumerate.rs Minor allocation/order cleanup in ALSA enumeration.
src/host/asio/device.rs Boxes ASIO sample-rate list and updates DeviceId/description calls.
src/host/audioworklet/mod.rs Updates default description and DeviceId construction.
src/host/coreaudio/ios/mod.rs Updates iOS default description and DeviceId construction.
src/host/coreaudio/macos/device.rs Updates CoreAudio DeviceId construction.
src/host/jack/device.rs Updates JACK string ownership and DeviceId construction.
src/host/jack/stream.rs Stores JACK port names as boxed slices.
src/host/null/mod.rs Updates null backend DeviceId construction.
src/host/pipewire/device.rs Shares allowed rates via Arc slices and streamlines parsing.
src/host/pulseaudio/mod.rs Updates PulseAudio DeviceId construction.
src/host/wasapi/device.rs Updates WASAPI DeviceId construction.
src/host/webaudio/mod.rs Updates WebAudio default description and DeviceId construction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread UPGRADING.md Outdated
Comment thread src/host/alsa/mod.rs Outdated
Comment thread src/host/pulseaudio/mod.rs Outdated
Comment thread src/host/wasapi/device.rs Outdated
Comment thread src/host/coreaudio/macos/device.rs Outdated
Comment thread src/host/aaudio/mod.rs Outdated
@roderickvd roderickvd force-pushed the refactor/seal-box-and-arc branch from 8d5457d to 61d78c8 Compare May 19, 2026 18:07
@roderickvd roderickvd merged commit 1d3e602 into master May 19, 2026
34 checks passed
@roderickvd roderickvd deleted the refactor/seal-box-and-arc branch May 19, 2026 18:18
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