device: take advantage of lifetime elision

This commit is contained in:
meh 2015-05-12 19:55:48 +02:00
parent 8a8ee131d7
commit 46a9746e00

View File

@ -18,13 +18,13 @@ impl<'a> Info<'a> {
Info { ptr: ptr, _marker: PhantomData } Info { ptr: ptr, _marker: PhantomData }
} }
pub fn name(&self) -> &'a str { pub fn name(&self) -> &str {
unsafe { unsafe {
from_utf8_unchecked(CStr::from_ptr((*self.ptr).device_name).to_bytes()) from_utf8_unchecked(CStr::from_ptr((*self.ptr).device_name).to_bytes())
} }
} }
pub fn description(&self) -> &'a str { pub fn description(&self) -> &str {
unsafe { unsafe {
from_utf8_unchecked(CStr::from_ptr((*self.ptr).device_description).to_bytes()) from_utf8_unchecked(CStr::from_ptr((*self.ptr).device_description).to_bytes())
} }