diff --git a/src/string.rs b/src/string.rs index ac76f39..3756211 100644 --- a/src/string.rs +++ b/src/string.rs @@ -319,7 +319,7 @@ impl ToString for CFString { impl fmt::Show for CFString { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - self.to_string().fmt(f) + write!(f, "{}", self.to_string()) } } diff --git a/src/url.rs b/src/url.rs index cfe6e2f..d2dd452 100644 --- a/src/url.rs +++ b/src/url.rs @@ -72,8 +72,7 @@ impl fmt::Show for CFURL { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { unsafe { let string: CFString = TCFType::wrap_under_get_rule(CFURLGetString(self.obj)); - let s = string.to_string(); - s.fmt(f) + write!(f, "{}", string.to_string()) } } } @@ -174,7 +173,7 @@ extern { //fn CFURLHasDirectoryPath /* Converting URLs to Other Representations */ - //fn CFURLCreateData(allocator: CFAllocatorRef, url: CFURLRef, + //fn CFURLCreateData(allocator: CFAllocatorRef, url: CFURLRef, // encoding: CFStringEncoding, escapeWhitespace: bool) -> CFDataRef; //fn CFURLCreateStringByAddingPercentEscapes //fn CFURLCreateStringByReplacingPercentEscapes