feat(errors): completed errors

This commit is contained in:
2026-09-06 22:26:34 +02:00
parent ad542a4892
commit fe01747f82
6 changed files with 16 additions and 8 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ impl PositiveNonzeroInteger {
fn parse(s: &str) -> Result<Self, ParsePosNonzeroError> {
// TODO: change this to return an appropriate error instead of panicking
// when `parse()` returns an error.
let x: i64 = s.parse().unwrap();
let x: i64 = s.parse().map_err(ParsePosNonzeroError::ParseInt)?;
Self::new(x).map_err(ParsePosNonzeroError::Creation)
}
}