Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Increase endpoint descriptor's lifetime #149

Merged
merged 1 commit into from
Oct 23, 2022

Conversation

mciantyre
Copy link
Contributor

From my understanding, all state derived from a ConfigDescriptor has a lifetime associated to that ConfigDescriptor. So, it's safe for the EndpointDescriptor to adopt the ConfigDescriptor's lifetime through the InterfaceDescriptor.

The new test shows us that the lifetimes are now all equal. This test wouldn't compile without the signature change.

Before this commit, the lifetime of the endpoint descriptor was shorter
than the lifetime of the config descriptor, since it was tied to the
InterfaceDescriptor object. This commit amends the endpoint_descriptors
signature so that an EndpointDescriptor has the same lifetime as the
overarching ConfigDescriptor.

From my understanding, all state derived from a ConfigDescriptor has a
lifetime associated to that ConfigDescriptor. So, it's safe for the
EndpointDescriptor to adopt the ConfigDescriptor's lifetime through the
InterfaceDescriptor.

The new test shows us that the lifetimes are now all equal. This test
wouldn't compile without the signature change.
@a1ien
Copy link
Owner

a1ien commented Oct 23, 2022

LGTM. Thanks.

@a1ien a1ien merged commit bb2fc51 into a1ien:master Oct 23, 2022
@mciantyre mciantyre deleted the ep-desc-lifetime branch October 23, 2022 11:54
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants