Skip to content

refactor(driver): shared fd#661

Merged
George-Miao merged 1 commit intocompio-rs:masterfrom
George-Miao:refactor/driver/shared-fd
Feb 5, 2026
Merged

refactor(driver): shared fd#661
George-Miao merged 1 commit intocompio-rs:masterfrom
George-Miao:refactor/driver/shared-fd

Conversation

@George-Miao
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings February 5, 2026 05:31
@George-Miao George-Miao self-assigned this Feb 5, 2026
@George-Miao George-Miao added package: driver Related to compio-driver refactor Refactoring existing code labels Feb 5, 2026
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 refactors the SharedFd implementation in the driver module to improve code maintainability by extracting common logic into a helper method.

Changes:

  • Introduced into_inner helper method to extract the inner Shared<Inner<T>> from SharedFd<T>
  • Simplified try_unwrap to use the new into_inner helper
  • Refactored take method to use into_inner and eliminate the unsafe try_unwrap_inner helper

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

Copy link
Member

@Berrysoft Berrysoft left a comment

Choose a reason for hiding this comment

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

LGTM. There's similar code in compio-quic, for EndpointRef. Could you also refactor for it?

@George-Miao
Copy link
Member Author

EndpointRef

Sure. Will open another PR for that.

@George-Miao George-Miao requested a review from Berrysoft February 5, 2026 06:13
Copy link
Member

@Berrysoft Berrysoft left a comment

Choose a reason for hiding this comment

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

LGTM. Genius!

@George-Miao George-Miao merged commit 2f59959 into compio-rs:master Feb 5, 2026
60 checks passed
@George-Miao George-Miao deleted the refactor/driver/shared-fd branch February 5, 2026 06:15
@github-actions github-actions bot mentioned this pull request Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: driver Related to compio-driver refactor Refactoring existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants