Skip to content

Commit

Permalink
fix: ::new constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerixyz committed Jan 28, 2022
1 parent b5a31c6 commit 36edf43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/libs/windows/src/core/agile_reference.rs
Expand Up @@ -8,9 +8,9 @@ pub struct AgileReference<T> {
}

impl<T: Interface> AgileReference<T> {
pub fn new<'a, R>(from_ref: R) -> Result<Self>
pub fn new<'a>(from_ref: &'a T) -> Result<Self>
where
R: IntoParam<'a, T> + IntoParam<'a, IUnknown>,
&'a T: IntoParam<'a, IUnknown>,
{
let reference = unsafe { RoGetAgileReference(AGILEREFERENCE_DEFAULT, &T::IID, from_ref)? };
Ok(Self { reference, _marker: Default::default() })
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/agile_reference/tests/tests.rs
Expand Up @@ -4,7 +4,7 @@ use windows::Media::Control::GlobalSystemMediaTransportControlsSessionManager;
#[test]
fn test() {
let manager = GlobalSystemMediaTransportControlsSessionManager::RequestAsync().unwrap().get().unwrap();
let reference = AgileReference::<GlobalSystemMediaTransportControlsSessionManager>::new(manager).unwrap();
let reference = AgileReference::new(&manager).unwrap();

let handle = std::thread::spawn(move || {
let manager = reference.resolve().unwrap();
Expand Down

0 comments on commit 36edf43

Please sign in to comment.