Skip to content

Conversation

@jerrysxie
Copy link
Contributor

@jerrysxie jerrysxie commented Dec 24, 2025

This pull request makes a minor change to the Policy implementation, updating the power_capability method to return an Option<ProviderPowerCapability> instead of unwrapping the result. This improves error handling by allowing callers to handle cases where the capability is unavailable.

@jerrysxie jerrysxie self-assigned this Dec 24, 2025
@jerrysxie jerrysxie added the enhancement New feature or request label Dec 24, 2025
Copilot AI review requested due to automatic review settings December 24, 2025 00:35
@jerrysxie jerrysxie added the BREAKING CHANGE Marks breaking changes label Dec 24, 2025
@jerrysxie jerrysxie marked this pull request as ready for review December 24, 2025 00:36
@jerrysxie jerrysxie requested a review from a team as a code owner December 24, 2025 00:36
@jerrysxie jerrysxie enabled auto-merge (squash) December 24, 2025 00:36
Copy link
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 removes a panic path from the power_capability() method in the Policy<ConnectedProvider> implementation by changing its return type from ProviderPowerCapability to Option<ProviderPowerCapability> and eliminating the .unwrap() call.

  • Changed power_capability() return type to Option<ProviderPowerCapability> to propagate the optional nature of the underlying device capability
  • Removed the .unwrap() call that could cause panics when the provider capability is not available

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

@jerrysxie
Copy link
Contributor Author

@jerrysxie jerrysxie disabled auto-merge December 24, 2025 01:11
@jerrysxie
Copy link
Contributor Author

Bypassed policy since this change is minor and people are out on vacation.

@jerrysxie jerrysxie merged commit cf625d6 into OpenDevicePartnership:main Dec 24, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BREAKING CHANGE Marks breaking changes enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants