Use already present lifetime

This commit is contained in:
Jameson Ernst
2014-12-18 23:25:10 -08:00
parent 2bd9db4f54
commit ef6102b2b6
+1 -1
View File
@@ -49,7 +49,7 @@ pub struct Timer<'a> {
}
impl<'a> Timer<'a> {
pub fn new<'b>(delay: uint, callback: ||: 'b -> uint, remove_on_drop: bool) -> Timer<'b> {
pub fn new(delay: uint, callback: ||: 'a -> uint, remove_on_drop: bool) -> Timer<'a> {
unsafe {
let c_param = mem::transmute::<_, raw::Closure>(callback);
Timer { delay: delay, raw: 0, closure: c_param, remove_on_drop: remove_on_drop, lifetime: ContravariantLifetime }