aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ffi.rs3
-rw-r--r--src/utils.rs12
2 files changed, 1 insertions, 14 deletions
diff --git a/src/ffi.rs b/src/ffi.rs
index 29b2ea7..1ee940a 100644
--- a/src/ffi.rs
+++ b/src/ffi.rs
@@ -19,7 +19,6 @@ use std::{
use utils::{
NotmuchType,
- ToStaticStr,
ToStr,
};
@@ -70,7 +69,7 @@ impl ToStr for NotmuchStatus {
fn to_str<'a>(&self) -> Result<&'a str, str::Utf8Error> {
unsafe {
notmuch_status_to_string(self.to_notmuch_t())
- }.to_static_str()
+ }.to_str()
}
}
diff --git a/src/utils.rs b/src/utils.rs
index ad6cf9b..75a5788 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -35,15 +35,3 @@ impl ToStr for *const libc::c_char {
}.to_bytes())
}
}
-
-pub trait ToStaticStr {
- fn to_static_str(&self) -> Result<&'static str, str::Utf8Error>;
-}
-
-impl ToStaticStr for *const libc::c_char {
- fn to_static_str(&self) -> Result<&'static str, str::Utf8Error> {
- str::from_utf8(unsafe {
- ffi::CStr::from_ptr(*self)
- }.to_bytes())
- }
-}