From b905279ce0257509f5350723904b20612e7a510d Mon Sep 17 00:00:00 2001 From: Kenny Kerr Date: Thu, 14 Dec 2023 08:29:52 -0600 Subject: [PATCH] bindgen --- .../impl/Foundation/Collections/Iterable.rs | 10 +++--- .../impl/Foundation/Collections/MapView.rs | 32 +++++++++---------- .../impl/Foundation/Collections/VectorView.rs | 12 +++---- crates/libs/bindgen/src/rust/writer.rs | 4 +-- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/Iterable.rs b/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/Iterable.rs index f004131c94..80533532bf 100644 --- a/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/Iterable.rs +++ b/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/Iterable.rs @@ -2,7 +2,7 @@ struct StockIterable where T: ::windows_core::RuntimeType + 'static, - >::Default: Clone, + T::Default: Clone, { values: Vec, } @@ -10,7 +10,7 @@ where impl IIterable_Impl for StockIterable where T: ::windows_core::RuntimeType, - >::Default: Clone, + T::Default: Clone, { fn First(&self) -> ::windows_core::Result> { unsafe { @@ -29,7 +29,7 @@ where struct StockIterator where T: ::windows_core::RuntimeType + 'static, - >::Default: Clone, + T::Default: Clone, { owner: IIterable, current: ::std::sync::atomic::AtomicUsize, @@ -38,7 +38,7 @@ where impl IIterator_Impl for StockIterator where T: ::windows_core::RuntimeType, - >::Default: Clone, + T::Default: Clone, { fn Current(&self) -> ::windows_core::Result { let owner: &StockIterable = unsafe { ::windows_core::AsImpl::as_impl(&self.owner) }; @@ -86,7 +86,7 @@ where impl ::core::convert::TryFrom> for IIterable where T: ::windows_core::RuntimeType, - >::Default: Clone, + T::Default: Clone, { type Error = ::windows_core::Error; fn try_from(values: Vec) -> ::windows_core::Result { diff --git a/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/MapView.rs b/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/MapView.rs index ec11504d54..7e82135442 100644 --- a/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/MapView.rs +++ b/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/MapView.rs @@ -3,8 +3,8 @@ struct StockMapView where K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static, - >::Default: Clone + Ord, - >::Default: Clone, + K::Default: Clone + Ord, + V::Default: Clone, { map: std::collections::BTreeMap, } @@ -13,8 +13,8 @@ impl IIterable_Impl> for StockMapView where K: ::windows_core::RuntimeType, V: ::windows_core::RuntimeType, - >::Default: Clone + Ord, - >::Default: Clone, + K::Default: Clone + Ord, + V::Default: Clone, { fn First(&self) -> ::windows_core::Result>> { unsafe { @@ -33,8 +33,8 @@ impl IMapView_Impl for StockMapView where K: ::windows_core::RuntimeType, V: ::windows_core::RuntimeType, - >::Default: Clone + Ord, - >::Default: Clone, + K::Default: Clone + Ord, + V::Default: Clone, { fn Lookup(&self, key: &K::Default) -> ::windows_core::Result { let value = self @@ -65,8 +65,8 @@ struct StockMapViewIterator<'a, K, V> where K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static, - >::Default: Clone + Ord, - >::Default: Clone, + K::Default: Clone + Ord, + V::Default: Clone, { _owner: IIterable>, current: ::std::sync::RwLock>, @@ -76,8 +76,8 @@ impl<'a, K, V> IIterator_Impl> for StockMapViewIterator<'a, where K: ::windows_core::RuntimeType, V: ::windows_core::RuntimeType, - >::Default: Clone + Ord, - >::Default: Clone, + K::Default: Clone + Ord, + V::Default: Clone, { fn Current(&self) -> ::windows_core::Result> { let mut current = self.current.read().unwrap().clone().peekable(); @@ -134,8 +134,8 @@ struct StockKeyValuePair where K: ::windows_core::RuntimeType + 'static, V: ::windows_core::RuntimeType + 'static, - >::Default: Clone, - >::Default: Clone, + K::Default: Clone, + V::Default: Clone, { key: K::Default, value: V::Default, @@ -145,8 +145,8 @@ impl IKeyValuePair_Impl for StockKeyValuePair where K: ::windows_core::RuntimeType, V: ::windows_core::RuntimeType, - >::Default: Clone, - >::Default: Clone, + K::Default: Clone, + V::Default: Clone, { fn Key(&self) -> ::windows_core::Result { K::from_default(&self.key) @@ -161,8 +161,8 @@ impl ::core::convert::TryFrom>::Default: Clone + Ord, - >::Default: Clone, + K::Default: Clone + Ord, + V::Default: Clone, { type Error = ::windows_core::Error; fn try_from( diff --git a/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/VectorView.rs b/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/VectorView.rs index f247cc16b2..279b62d7fe 100644 --- a/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/VectorView.rs +++ b/crates/libs/bindgen/src/rust/extensions/impl/Foundation/Collections/VectorView.rs @@ -2,7 +2,7 @@ struct StockVectorView where T: ::windows_core::RuntimeType + 'static, - >::Default: Clone + PartialEq, + T::Default: Clone + PartialEq, { values: Vec, } @@ -10,7 +10,7 @@ where impl IIterable_Impl for StockVectorView where T: ::windows_core::RuntimeType, - >::Default: Clone + PartialEq, + T::Default: Clone + PartialEq, { fn First(&self) -> ::windows_core::Result> { unsafe { @@ -28,7 +28,7 @@ where impl IVectorView_Impl for StockVectorView where T: ::windows_core::RuntimeType, - >::Default: Clone + PartialEq, + T::Default: Clone + PartialEq, { fn GetAt(&self, index: u32) -> ::windows_core::Result { let item = self @@ -65,7 +65,7 @@ where struct StockVectorViewIterator where T: ::windows_core::RuntimeType + 'static, - >::Default: Clone + PartialEq, + T::Default: Clone + PartialEq, { owner: IIterable, current: ::std::sync::atomic::AtomicUsize, @@ -74,7 +74,7 @@ where impl IIterator_Impl for StockVectorViewIterator where T: ::windows_core::RuntimeType, - >::Default: Clone + PartialEq, + T::Default: Clone + PartialEq, { fn Current(&self) -> ::windows_core::Result { let owner: &StockVectorView = unsafe { ::windows_core::AsImpl::as_impl(&self.owner) }; @@ -122,7 +122,7 @@ where impl ::core::convert::TryFrom> for IVectorView where T: ::windows_core::RuntimeType, - >::Default: Clone + PartialEq, + T::Default: Clone + PartialEq, { type Error = ::windows_core::Error; fn try_from(values: Vec) -> ::windows_core::Result { diff --git a/crates/libs/bindgen/src/rust/writer.rs b/crates/libs/bindgen/src/rust/writer.rs index 5e4572efc0..2b1f9e3e39 100644 --- a/crates/libs/bindgen/src/rust/writer.rs +++ b/crates/libs/bindgen/src/rust/writer.rs @@ -660,7 +660,7 @@ impl Writer { }; quote! { - .push_other(<#g as ::windows_core::RuntimeType>::SIGNATURE) + .push_other(#g::SIGNATURE) #semi } }); @@ -900,7 +900,7 @@ impl Writer { quote! { result__ as *mut _ as *mut _, } } metadata::SignatureKind::Query(query) | metadata::SignatureKind::QueryOptional(query) if query.guid == position => { - quote! { &::IID, } + quote! { &T::IID, } } _ => { let name = self.param_name(param.def);