#![warn( clippy::all, clippy::pedantic, clippy::nursery, clippy::cargo, )] use std::str::FromStr; #[derive(Debug)] pub struct BirthDeath { pub birth: f32, pub death: f32, } impl FromStr for BirthDeath { type Err = std::string::ParseError; fn from_str(s: &str) -> Result { let (b, d) = s.split_once(' ').unwrap(); return Ok(Self { birth: b.trim().parse().unwrap(), death: d.trim().parse().unwrap(), }); } }