]> git.proxmox.com Git - cargo.git/blobdiff - vendor/core-foundation/src/propertylist.rs
New upstream version 0.35.0
[cargo.git] / vendor / core-foundation / src / propertylist.rs
index 9a2703b2a0fd81f7377aca115af5477332548e14..14ae173d6a39f9d0b0df587c157a097dd1bc8059 100644 (file)
@@ -121,7 +121,7 @@ impl CFPropertyList {
 
     #[inline]
     pub unsafe fn wrap_under_get_rule(reference: CFPropertyListRef) -> CFPropertyList {
-        let reference = mem::transmute(CFRetain(mem::transmute(reference)));
+        let reference = CFRetain(reference);
         CFPropertyList(reference)
     }
 
@@ -142,7 +142,7 @@ impl CFPropertyList {
 
     #[inline]
     pub fn as_CFTypeRef(&self) -> ::core_foundation_sys::base::CFTypeRef {
-        unsafe { mem::transmute(self.as_concrete_TypeRef()) }
+        self.as_concrete_TypeRef()
     }
 
     #[inline]
@@ -208,7 +208,7 @@ impl CFPropertyList {
     /// // Cast it up to a property list.
     /// let propertylist: CFPropertyList = string.to_CFPropertyList();
     /// // Cast it down again.
-    /// assert!(propertylist.downcast::<CFString>().unwrap().to_string() == "FooBar");
+    /// assert_eq!(propertylist.downcast::<CFString>().unwrap().to_string(), "FooBar");
     /// ```
     ///
     /// [`CFPropertyList`]: struct.CFPropertyList.html
@@ -271,7 +271,7 @@ pub mod test {
         let data = create_data(dict1.as_CFTypeRef(), kCFPropertyListXMLFormat_v1_0).unwrap();
         let (dict2, _) = create_with_data(data, kCFPropertyListImmutable).unwrap();
         unsafe {
-            assert!(CFEqual(dict1.as_CFTypeRef(), dict2) == 1);
+            assert_eq!(CFEqual(dict1.as_CFTypeRef(), dict2), 1);
         }
     }
 
@@ -291,7 +291,7 @@ pub mod test {
     #[test]
     fn downcast_string() {
         let propertylist = CFString::from_static_string("Bar").to_CFPropertyList();
-        assert!(propertylist.downcast::<CFString>().unwrap().to_string() == "Bar");
+        assert_eq!(propertylist.downcast::<CFString>().unwrap().to_string(), "Bar");
         assert!(propertylist.downcast::<CFBoolean>().is_none());
     }
 
@@ -319,7 +319,7 @@ pub mod test {
         assert_eq!(string.retain_count(), 2);
 
         let string2 = propertylist.downcast_into::<CFString>().unwrap();
-        assert!(string2.to_string() == "Bar");
+        assert_eq!(string2.to_string(), "Bar");
         assert_eq!(string2.retain_count(), 2);
     }
 }