Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for rust nightly #55

Merged
merged 1 commit into from Feb 4, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -12,7 +12,7 @@

#![allow(non_snake_case)]

#![feature(core, libc, collections)]
#![feature(core, libc)]

extern crate libc;

@@ -263,17 +263,19 @@ impl TCFType<CFStringRef> for CFString {
}

impl FromStr for CFString {
type Err = ();

/// Creates a new `CFString` instance from a Rust string.
#[inline]
fn from_str(string: &str) -> Option<CFString> {
fn from_str(string: &str) -> Result<CFString, ()> {
unsafe {
let string_ref = CFStringCreateWithBytes(kCFAllocatorDefault,
string.as_ptr(),
string.len().to_CFIndex(),
kCFStringEncodingUTF8,
false as Boolean,
kCFAllocatorNull);
Some(TCFType::wrap_under_create_rule(string_ref))
Some(TCFType::wrap_under_create_rule(string_ref)).ok_or(())
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.