From 2128be8b2855f2640137491cb1ed0c9d89721603 Mon Sep 17 00:00:00 2001 From: Matt Nield <64328730+matthewjnield@users.noreply.github.com> Date: Sun, 4 Aug 2024 02:36:45 -0400 Subject: chore: Fix snakecase convention in errors6.rs Exercise errors6.rs prompts the user to add a method named `from_parseint`. This commit changes the method name to the corrected snakecase format, `from_parse_int`. --- solutions/13_error_handling/errors6.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'solutions/13_error_handling/errors6.rs') 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 { // 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) } -- cgit v1.2.3