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 72b39f56ec..9176b5d903 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 @@ -44,7 +44,7 @@ where V::from_default(value) } fn Size(&self) -> ::windows_core::Result { - Ok(self.map.len() as u32) + Ok(self.map.len().try_into()?) } fn HasKey(&self, key: &K::Default) -> ::windows_core::Result { Ok(self.map.contains_key(key)) 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 cc482b70fd..561681b167 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 @@ -38,7 +38,7 @@ where T::from_default(item) } fn Size(&self) -> ::windows_core::Result { - Ok(self.values.len() as u32) + Ok(self.values.len().try_into()?) } fn IndexOf(&self, value: &T::Default, result: &mut u32) -> ::windows_core::Result { match self.values.iter().position(|element| element == value) { diff --git a/crates/libs/windows/src/Windows/Foundation/Collections/impl.rs b/crates/libs/windows/src/Windows/Foundation/Collections/impl.rs index eab17e991e..a991bd562e 100644 --- a/crates/libs/windows/src/Windows/Foundation/Collections/impl.rs +++ b/crates/libs/windows/src/Windows/Foundation/Collections/impl.rs @@ -837,7 +837,7 @@ where V::from_default(value) } fn Size(&self) -> ::windows_core::Result { - Ok(self.map.len() as u32) + Ok(self.map.len().try_into()?) } fn HasKey(&self, key: &K::Default) -> ::windows_core::Result { Ok(self.map.contains_key(key)) @@ -981,7 +981,7 @@ where T::from_default(item) } fn Size(&self) -> ::windows_core::Result { - Ok(self.values.len() as u32) + Ok(self.values.len().try_into()?) } fn IndexOf(&self, value: &T::Default, result: &mut u32) -> ::windows_core::Result { match self.values.iter().position(|element| element == value) {