refactor: seal DeviceId, use impl AsRef<str> in builder, and box frozen slice fields#1210
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
DeviceIdopaque with constructor/accessor methods and updates backend call sites. - Changes
DeviceDescription::extended()to return&striterator 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.
8d5457d to
61d78c8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some refactoring for efficiency, clearer intent, and foot-shooting prevention.