chore: Fix snakecase convention in errors6.rs

Solution errors6.rs contains a method named `from_parseint`. This commit changes the method name to the corrected snakecase format, `from_parse_int`.
This commit is contained in:
Matt Nield 2024-08-04 02:34:00 -04:00 committed by GitHub
parent 8a9f9a898d
commit b7b03e19fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,7 +24,7 @@ impl ParsePosNonzeroError {
Self::Creation(err)
}
fn from_parseint(err: ParseIntError) -> Self {
fn from_parse_int(err: ParseIntError) -> Self {
Self::ParseInt(err)
}
}
@ -44,7 +44,7 @@ impl PositiveNonzeroInteger {
fn parse(s: &str) -> Result<Self, ParsePosNonzeroError> {
// Return an appropriate error instead of panicking when `parse()`
// returns an error.
let x: i64 = s.parse().map_err(ParsePosNonzeroError::from_parseint)?;
let x: i64 = s.parse().map_err(ParsePosNonzeroError::from_parse_int)?;
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Self::new(x).map_err(ParsePosNonzeroError::from_creation)
}