diff --git a/crates/libs/core/src/variant.rs b/crates/libs/core/src/variant.rs index d6f0fbde73..9bddb4e26c 100644 --- a/crates/libs/core/src/variant.rs +++ b/crates/libs/core/src/variant.rs @@ -20,7 +20,7 @@ impl Default for PROPVARIANT { impl Clone for VARIANT { fn clone(&self) -> Self { - unsafe { + unsafe { let mut value = Self::new(); imp::VariantCopy(&mut value.0, &self.0); value @@ -30,7 +30,7 @@ impl Clone for VARIANT { impl Clone for PROPVARIANT { fn clone(&self) -> Self { - unsafe { + unsafe { let mut value = Self::new(); imp::PropVariantCopy(&mut value.0, &self.0); value diff --git a/crates/libs/metadata/src/reader.rs b/crates/libs/metadata/src/reader.rs index e9c2a360ee..6654988a70 100644 --- a/crates/libs/metadata/src/reader.rs +++ b/crates/libs/metadata/src/reader.rs @@ -141,11 +141,19 @@ impl Reader { } pub fn remap_types(&self) -> impl Iterator + '_ { - if self.sys { [].iter() } else { REMAP_TYPES.iter() } + if self.sys { + [].iter() + } else { + REMAP_TYPES.iter() + } } pub fn core_types(&self) -> impl Iterator + '_ { - if self.sys { SYS_CORE_TYPES.iter() } else { CORE_TYPES.iter() } + if self.sys { + SYS_CORE_TYPES.iter() + } else { + CORE_TYPES.iter() + } } pub fn type_from_ref(&self, code: TypeDefOrRef, enclosing: Option, generics: &[Type]) -> Type { diff --git a/crates/tests/implement/tests/properties.rs b/crates/tests/implement/tests/properties.rs index a396f4c520..c577e15250 100644 --- a/crates/tests/implement/tests/properties.rs +++ b/crates/tests/implement/tests/properties.rs @@ -1,9 +1,6 @@ #![allow(non_snake_case)] -use windows::{ - core::*, Win32::System::Com::*, - Win32::UI::Shell::PropertiesSystem::*, -}; +use windows::{core::*, Win32::System::Com::*, Win32::UI::Shell::PropertiesSystem::*}; #[implement(IInitializeWithStream, IPropertyStore, IPropertyStoreCapabilities)] struct Object(std::sync::RwLock); diff --git a/crates/tests/variant/tests/tests.rs b/crates/tests/variant/tests/tests.rs index 0954df6c77..0fe860e5d0 100644 --- a/crates/tests/variant/tests/tests.rs +++ b/crates/tests/variant/tests/tests.rs @@ -71,8 +71,14 @@ fn test_variant() -> Result<()> { let v = VARIANT::from(BSTR::from("hello")); assert_eq!(BSTR::try_from(&v)?, "hello"); - assert_eq!(VARIANT::from(BSTR::from("hello")), VARIANT::from(BSTR::from("hello"))); - assert_ne!(VARIANT::from(BSTR::from("hello")), VARIANT::from(BSTR::from("goodbye"))); + assert_eq!( + VARIANT::from(BSTR::from("hello")), + VARIANT::from(BSTR::from("hello")) + ); + assert_ne!( + VARIANT::from(BSTR::from("hello")), + VARIANT::from(BSTR::from("goodbye")) + ); let v = VARIANT::from(3.5f64); assert_eq!(BSTR::try_from(&v)?, "3.5"); @@ -87,7 +93,6 @@ fn test_variant() -> Result<()> { Ok(()) } - #[test] fn test_propvariant() -> Result<()> { let empty: PROPVARIANT = PROPVARIANT::new(); @@ -139,12 +144,18 @@ fn test_propvariant() -> Result<()> { let v = PROPVARIANT::from(5294967295u64); assert_eq!(u64::try_from(&v)?, 5294967295u64); - assert_eq!(PROPVARIANT::from(5294967295u64), PROPVARIANT::from(5294967295u64)); + assert_eq!( + PROPVARIANT::from(5294967295u64), + PROPVARIANT::from(5294967295u64) + ); assert_ne!(PROPVARIANT::from(5294967295u64), PROPVARIANT::from(0u64)); let v = PROPVARIANT::from(-5294967295i64); assert_eq!(i64::try_from(&v)?, -5294967295i64); - assert_eq!(PROPVARIANT::from(-5294967295i64), PROPVARIANT::from(-5294967295i64)); + assert_eq!( + PROPVARIANT::from(-5294967295i64), + PROPVARIANT::from(-5294967295i64) + ); assert_ne!(PROPVARIANT::from(-5294967295i64), PROPVARIANT::from(0i64)); let v = PROPVARIANT::from(3.5f32); @@ -159,8 +170,14 @@ fn test_propvariant() -> Result<()> { let v = PROPVARIANT::from(BSTR::from("hello")); assert_eq!(BSTR::try_from(&v)?, "hello"); - assert_eq!(PROPVARIANT::from(BSTR::from("hello")), PROPVARIANT::from(BSTR::from("hello"))); - assert_ne!(PROPVARIANT::from(BSTR::from("hello")), PROPVARIANT::from(BSTR::from("goodbye"))); + assert_eq!( + PROPVARIANT::from(BSTR::from("hello")), + PROPVARIANT::from(BSTR::from("hello")) + ); + assert_ne!( + PROPVARIANT::from(BSTR::from("hello")), + PROPVARIANT::from(BSTR::from("goodbye")) + ); let v = PROPVARIANT::from(3.5f64); assert_eq!(BSTR::try_from(&v)?, "3.5"); @@ -173,4 +190,4 @@ fn test_propvariant() -> Result<()> { assert_ne!(v, PROPVARIANT::from(true)); Ok(()) -} \ No newline at end of file +}