1
0
Fork 0
mirror of https://github.com/notohh/rustlings.git synced 2025-11-08 05:48:11 -05:00

rustfmt the exercises

Signed-off-by: Eddy Petrisor <eddy.petrisor@gmail.com>
This commit is contained in:
Eddy Petrisor 2019-05-22 14:48:32 +03:00
commit 9aec4abc4d
4 changed files with 17 additions and 11 deletions
exercises/error_handling

View file

@ -65,7 +65,7 @@ fn test_ioerror() {
assert_eq!("uh-oh!", read_and_validate(&mut b).unwrap_err().to_string());
}
#[derive(PartialEq,Debug)]
#[derive(PartialEq, Debug)]
struct PositiveNonzeroInteger(u64);
impl PositiveNonzeroInteger {
@ -83,11 +83,14 @@ impl PositiveNonzeroInteger {
#[test]
fn test_positive_nonzero_integer_creation() {
assert!(PositiveNonzeroInteger::new(10).is_ok());
assert_eq!(Err(CreationError::Negative), PositiveNonzeroInteger::new(-10));
assert_eq!(
Err(CreationError::Negative),
PositiveNonzeroInteger::new(-10)
);
assert_eq!(Err(CreationError::Zero), PositiveNonzeroInteger::new(0));
}
#[derive(PartialEq,Debug)]
#[derive(PartialEq, Debug)]
enum CreationError {
Negative,
Zero,