Implement Clone for all types
Not just CFString
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user