From 152193b459085c2bdfe41f65df7ea04a032d2a4c Mon Sep 17 00:00:00 2001 From: mfurak Date: Sun, 6 Nov 2022 20:42:17 +0100 Subject: [PATCH] style: format errors6 with rustfmt --- exercises/error_handling/errors6.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/exercises/error_handling/errors6.rs b/exercises/error_handling/errors6.rs index 1306fb0..8097b49 100644 --- a/exercises/error_handling/errors6.rs +++ b/exercises/error_handling/errors6.rs @@ -16,7 +16,7 @@ use std::num::ParseIntError; #[derive(PartialEq, Debug)] enum ParsePosNonzeroError { Creation(CreationError), - ParseInt(ParseIntError) + ParseInt(ParseIntError), } impl ParsePosNonzeroError { @@ -27,14 +27,11 @@ impl ParsePosNonzeroError { // fn from_parseint... } -fn parse_pos_nonzero(s: &str) - -> Result -{ +fn parse_pos_nonzero(s: &str) -> Result { // TODO: change this to return an appropriate error instead of panicking // when `parse()` returns an error. let x: i64 = s.parse().unwrap(); - PositiveNonzeroInteger::new(x) - .map_err(ParsePosNonzeroError::from_creation) + PositiveNonzeroInteger::new(x).map_err(ParsePosNonzeroError::from_creation) } // Don't change anything below this line. @@ -53,7 +50,7 @@ impl PositiveNonzeroInteger { match value { x if x < 0 => Err(CreationError::Negative), x if x == 0 => Err(CreationError::Zero), - x => Ok(PositiveNonzeroInteger(x as u64)) + x => Ok(PositiveNonzeroInteger(x as u64)), } } }