Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🐧

Makc singulared

💭
🐧
View GitHub Profile
@singulared
singulared / playground.rs
Last active Feb 5, 2020 — forked from rust-play/playground.rs
impl From variadic like :D
View playground.rs
#[derive(Debug)]
struct CM {
id: i32,
topic_id: i32,
}
#[derive(Debug)]
struct TM {
id: i32,
}
@singulared
singulared / state.rs
Created May 27, 2019 — forked from dbrgn/state.rs
Custom Text based Diesel type for an enum
View state.rs
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
#[serde(rename_all="snake_case")]
pub enum State {
Pending,
Sending,
Sent,
Failed,
}
impl fmt::Display for State {