feat: ability to view tasks in a category #19
@ -1,3 +1,4 @@
|
|||||||
|
use std::hash::Hash;
|
||||||
use crate::schema::tasks;
|
use crate::schema::tasks;
|
||||||
use chrono::{Duration, NaiveDate, NaiveTime};
|
use chrono::{Duration, NaiveDate, NaiveTime};
|
||||||
use diesel::deserialize::FromSql;
|
use diesel::deserialize::FromSql;
|
||||||
@ -11,7 +12,7 @@ use serde_with::DurationSeconds;
|
|||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
#[serde_with::serde_as]
|
#[serde_with::serde_as]
|
||||||
#[derive(AsExpression, FromSqlRow, Serialize, Deserialize, Hash, Clone, Debug)]
|
#[derive(AsExpression, FromSqlRow, Serialize, Deserialize, Clone, Debug)]
|
||||||
#[diesel(sql_type = Jsonb)]
|
#[diesel(sql_type = Jsonb)]
|
||||||
pub enum Category {
|
pub enum Category {
|
||||||
Inbox,
|
Inbox,
|
||||||
@ -45,6 +46,12 @@ impl Category {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Hash for Category {
|
||||||
|
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||||
|
std::mem::discriminant(self).hash(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl PartialEq for Category {
|
impl PartialEq for Category {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
std::mem::discriminant(self) == std::mem::discriminant(other)
|
std::mem::discriminant(self) == std::mem::discriminant(other)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user