Migrate what bit of the yapper.py script there was to rust.

This commit is contained in:
Olivia Brooks
2025-10-12 22:34:54 -04:00
parent bda1b138df
commit d9dcf43be8
6 changed files with 719 additions and 0 deletions

46
src/og.rs Normal file
View File

@@ -0,0 +1,46 @@
use std::fmt;
use serde::Deserialize;
#[derive(Clone, Debug, Deserialize)]
pub enum Gender {
Male,
Female,
}
impl fmt::Display for Gender {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{:?}", self)
}
}
impl Into<String> for Gender {
fn into(self) -> String {
self.to_string().to_lowercase()
}
}
#[derive(Clone, Debug, Deserialize)]
pub struct Author {
name: Name,
gender: Gender,
}
#[derive(Clone, Debug, Deserialize)]
pub enum Name {
FirstOnly {
first: String,
},
Full {
first: String,
last: String,
},
UserOnly {
user: String,
},
All {
first: String,
last: String,
user: String,
},
}