mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-22 05:52:23 -05:00
Merge pull request #2066 from matthewjnield/main
chore: Fix snakecase convention in errors6.rs
This commit is contained in:
commit
45a39585b3
2 changed files with 3 additions and 3 deletions
|
@ -25,7 +25,7 @@ impl ParsePosNonzeroError {
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Add another error conversion function here.
|
// TODO: Add another error conversion function here.
|
||||||
// fn from_parseint(???) -> Self { ??? }
|
// fn from_parse_int(???) -> Self { ??? }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Debug)]
|
||||||
|
|
|
@ -24,7 +24,7 @@ impl ParsePosNonzeroError {
|
||||||
Self::Creation(err)
|
Self::Creation(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn from_parseint(err: ParseIntError) -> Self {
|
fn from_parse_int(err: ParseIntError) -> Self {
|
||||||
Self::ParseInt(err)
|
Self::ParseInt(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ impl PositiveNonzeroInteger {
|
||||||
fn parse(s: &str) -> Result<Self, ParsePosNonzeroError> {
|
fn parse(s: &str) -> Result<Self, ParsePosNonzeroError> {
|
||||||
// Return an appropriate error instead of panicking when `parse()`
|
// Return an appropriate error instead of panicking when `parse()`
|
||||||
// returns an error.
|
// 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)
|
Self::new(x).map_err(ParsePosNonzeroError::from_creation)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue