summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMo <76752051+mo8it@users.noreply.github.com>2024-08-08 00:36:46 +0200
committerGitHub <noreply@github.com>2024-08-08 00:36:46 +0200
commit45a39585b382a28fc01128acf31c7a9d2d6ddf71 (patch)
treeb0b390aa7acefe28b2172c47a4fc61ad626ed415
parent286a455fa94bc638e6418d75634e28a78275b033 (diff)
parent2128be8b2855f2640137491cb1ed0c9d89721603 (diff)
Merge pull request #2066 from matthewjnield/main
chore: Fix snakecase convention in errors6.rs
-rw-r--r--exercises/13_error_handling/errors6.rs2
-rw-r--r--solutions/13_error_handling/errors6.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/exercises/13_error_handling/errors6.rs b/exercises/13_error_handling/errors6.rs
index b656c61..b1995e0 100644
--- a/exercises/13_error_handling/errors6.rs
+++ b/exercises/13_error_handling/errors6.rs
@@ -25,7 +25,7 @@ impl ParsePosNonzeroError {
}
// TODO: Add another error conversion function here.
- // fn from_parseint(???) -> Self { ??? }
+ // fn from_parse_int(???) -> Self { ??? }
}
#[derive(PartialEq, Debug)]
diff --git a/solutions/13_error_handling/errors6.rs b/solutions/13_error_handling/errors6.rs
index 429d3ea..8679361 100644
--- a/solutions/13_error_handling/errors6.rs
+++ b/solutions/13_error_handling/errors6.rs
@@ -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)
}