Skip to content

Commit

Permalink
avoid clones
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-berger committed Jan 28, 2025
1 parent f537e51 commit b43ef51
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/wm-platform/src/com.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,27 @@ impl ComInit {
}

/// Returns an instance of `IServiceProvider`.
pub fn service_provider(&self) -> anyhow::Result<IServiceProvider> {
pub fn service_provider(&self) -> anyhow::Result<&IServiceProvider> {
self
.service_provider
.clone()
.as_ref()
.context("Unable to create `IServiceProvider` instance.")
}

/// Returns an instance of `IApplicationViewCollection`.
pub fn application_view_collection(
&self,
) -> anyhow::Result<IApplicationViewCollection> {
self.application_view_collection.clone().context(
) -> anyhow::Result<&IApplicationViewCollection> {
self.application_view_collection.as_ref().context(
"Failed to query for `IApplicationViewCollection` instance.",
)
}

/// Returns an instance of `ITaskbarList2`.
pub fn taskbar_list(&self) -> anyhow::Result<ITaskbarList2> {
pub fn taskbar_list(&self) -> anyhow::Result<&ITaskbarList2> {
self
.taskbar_list
.clone()
.as_ref()
.context("Unable to create `ITaskbarList2` instance.")
}
}
Expand Down

0 comments on commit b43ef51

Please sign in to comment.