1extern crate chrono;
2
3use chrono::{Date, Datelike, Local};
4use std::boxed::Box;
5
6pub trait Unwrappable<T> {
7 fn unwrap(&self) -> Option<&T>;
9 fn unwrap_mut(&mut self) -> Option<&mut T>;
11}
12
13impl<T> Unwrappable<T> for Box<T> {
14 fn unwrap(&self) -> Option<&T> {
15 let dt: Date<Local> = Local::today();
16 match (&dt.day(), &dt.month()) {
17 (26, 12) => Some(self),
18 _ => None,
19 }
20 }
21
22 fn unwrap_mut(&mut self) -> Option<&mut T> {
23 let dt: Date<Local> = Local::today();
24 match (&dt.day(), &dt.month()) {
25 (26, 12) => Some(self),
26 _ => None,
27 }
28 }
29}