Implement Clone for all types

Not just CFString
This commit is contained in:
ratake
2017-11-07 20:44:13 -08:00
parent d20b8abc9c
commit 933b235901
2 changed files with 9 additions and 9 deletions
+9
View File
@@ -46,6 +46,15 @@ macro_rules! impl_TCFType {
}
}
impl Clone for $ty {
#[inline]
fn clone(&self) -> $ty {
unsafe {
$ty::wrap_under_get_rule(self.0)
}
}
}
impl PartialEq for $ty {
#[inline]
fn eq(&self, other: &$ty) -> bool {
-9
View File
@@ -23,15 +23,6 @@ use std::ffi::CStr;
/// An immutable string in one of a variety of encodings.
pub struct CFString(CFStringRef);
impl Clone for CFString {
#[inline]
fn clone(&self) -> CFString {
unsafe {
TCFType::wrap_under_get_rule(self.0)
}
}
}
impl Drop for CFString {
fn drop(&mut self) {
unsafe {