removed deprecated function
This commit is contained in:
12
src/types.rs
12
src/types.rs
@@ -11,23 +11,13 @@ pub struct Alarm {
|
||||
pub title: String,
|
||||
}
|
||||
|
||||
impl Alarm {
|
||||
pub fn new(id: i32, enabled: bool, time: DateTime<Utc>, title: String) -> Self {
|
||||
Self {
|
||||
id,
|
||||
enabled,
|
||||
time,
|
||||
title,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<model::alarm::Model> for Alarm {
|
||||
fn from(value: model::alarm::Model) -> Self {
|
||||
Self {
|
||||
id: value.id,
|
||||
enabled: value.enabled,
|
||||
time: DateTime::from_utc(value.time, Utc),
|
||||
time: DateTime::from_naive_utc_and_offset(value.time, Utc),
|
||||
title: value.title,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user