codec/codec: use lifetime elision

This commit is contained in:
meh 2015-05-12 20:07:06 +02:00
parent 2f4ca56e46
commit 5436f264a9

View File

@ -35,13 +35,13 @@ impl<'a> Codec<'a> {
} }
} }
pub fn name(&'a self) -> &'a str { pub fn name(&self) -> &str {
unsafe { unsafe {
from_utf8_unchecked(CStr::from_ptr((*self.ptr).name).to_bytes()) from_utf8_unchecked(CStr::from_ptr((*self.ptr).name).to_bytes())
} }
} }
pub fn description(&'a self) -> &'a str { pub fn description(&self) -> &str {
unsafe { unsafe {
from_utf8_unchecked(CStr::from_ptr((*self.ptr).long_name).to_bytes()) from_utf8_unchecked(CStr::from_ptr((*self.ptr).long_name).to_bytes())
} }