diff --git a/core-foundation/Cargo.toml b/core-foundation/Cargo.toml index 98edd47..5c2d1d5 100644 --- a/core-foundation/Cargo.toml +++ b/core-foundation/Cargo.toml @@ -3,7 +3,7 @@ name = "core-foundation" description = "Bindings to Core Foundation for macOS" homepage = "https://github.com/servo/core-foundation-rs" repository = "https://github.com/servo/core-foundation-rs" -version = "0.6.3" +version = "0.6.4" authors = ["The Servo Project Developers"] license = "MIT / Apache-2.0" categories = ["os::macos-apis"] diff --git a/core-foundation/src/dictionary.rs b/core-foundation/src/dictionary.rs index d63a9ca..f954b71 100644 --- a/core-foundation/src/dictionary.rs +++ b/core-foundation/src/dictionary.rs @@ -58,6 +58,13 @@ impl CFDictionary { unsafe { CFDictionary::wrap_under_get_rule(self.0) } } + /// Returns a `CFMutableDictionary` pointing to the same underlying dictionary as this immutable one. + /// This should only be used when the underlying dictionary is mutable. + #[inline] + pub unsafe fn to_mutable(&self) -> CFMutableDictionary { + CFMutableDictionary::wrap_under_get_rule(self.0 as CFMutableDictionaryRef) + } + /// Returns the same dictionary, but with the types reset to void pointers. /// Equal to `to_untyped`, but is faster since it does not increment the retain count. #[inline]