Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Simplify COM implementation traits #2301

Merged
merged 3 commits into from Jan 23, 2023
Merged

Simplify COM implementation traits #2301

merged 3 commits into from Jan 23, 2023

Conversation

kennykerr
Copy link
Collaborator

Currently, when implementing a COM method that accepts a COM interface as an input parameter you end up with a parameter that looks like this:

fn Method(&self, interface: &Option<IObject>);

This ends up being rather inconvenient because you necessarily have to convert the parameter from &Option<T> to Option<&T> via as_ref and then you need to check whether the option contains a value. With this change, the parameter looks like this:

fn Method(&self, interface: Option<&IObject>);

Naturally, a null parameter may still be passed by the caller but at least the as_ref is no longer required.

@kennykerr kennykerr merged commit be72085 into master Jan 23, 2023
@kennykerr kennykerr deleted the from_raw_borrowed branch January 23, 2023 23:40
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.

None yet

1 participant