Automatically delete members when families are deleted
This commit is contained in:
@ -130,7 +130,7 @@ pub enum Sex {
|
||||
}
|
||||
|
||||
impl Sex {
|
||||
pub fn from_str(s: &str) -> Option<Self> {
|
||||
pub fn parse_str(s: &str) -> Option<Self> {
|
||||
match s {
|
||||
"M" => Some(Sex::Male),
|
||||
"F" => Some(Sex::Female),
|
||||
@ -184,10 +184,7 @@ impl Member {
|
||||
}
|
||||
|
||||
pub fn sex(&self) -> Option<Sex> {
|
||||
self.sex
|
||||
.as_deref()
|
||||
.map(|s| Sex::from_str(s))
|
||||
.unwrap_or_default()
|
||||
self.sex.as_deref().map(Sex::parse_str).unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn set_sex(&mut self, s: Option<Sex>) {
|
||||
|
Reference in New Issue
Block a user