Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 679b807

Browse files
authored
Merge pull request #486 from GuillaumeGomez/missing-traits
Add missing traits
2 parents 8424ef0 + ce752bd commit 679b807

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/time_val.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use glib_sys;
66
use std::mem;
7+
use translate::{StashMut, ToGlibPtrMut, Uninitialized};
78

89
pub use glib_sys::GTimeVal as TimeVal;
910

@@ -14,3 +15,18 @@ pub fn get_current_time() -> TimeVal {
1415
ret
1516
}
1617
}
18+
19+
#[doc(hidden)]
20+
impl<'a> ToGlibPtrMut<'a, *mut glib_sys::GTimeVal> for TimeVal {
21+
type Storage = &'a mut Self;
22+
23+
fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut glib_sys::GTimeVal, Self> {
24+
StashMut(self as *mut _, self)
25+
}
26+
}
27+
28+
impl Uninitialized for TimeVal {
29+
unsafe fn uninitialized() -> TimeVal {
30+
mem::uninitialized()
31+
}
32+
}

0 commit comments

Comments
 (0)