device: take advantage of lifetime elision
This commit is contained in:
parent
8a8ee131d7
commit
46a9746e00
@ -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())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user