From 9a83067d04c9648416b92fc8d7b8a542b0b9aa96 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 10 Jan 2019 21:39:25 -0800 Subject: code docs/comments and rustfmt --- rust/src/errors.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'rust/src/errors.rs') diff --git a/rust/src/errors.rs b/rust/src/errors.rs index 19ba2f82..ec2b949b 100644 --- a/rust/src/errors.rs +++ b/rust/src/errors.rs @@ -116,9 +116,13 @@ impl Into for FatcatError { impl From for FatcatError { fn from(inner: diesel::result::Error) -> FatcatError { match inner { - diesel::result::Error::NotFound => FatcatError::NotFound("unknown".to_string(), "N/A".to_string()), - diesel::result::Error::DatabaseError(_, _) => FatcatError::ConstraintViolation(inner.to_string()), - _ => FatcatError::InternalError(inner.to_string()) + diesel::result::Error::NotFound => { + FatcatError::NotFound("unknown".to_string(), "N/A".to_string()) + } + diesel::result::Error::DatabaseError(_, _) => { + FatcatError::ConstraintViolation(inner.to_string()) + } + _ => FatcatError::InternalError(inner.to_string()), } } } @@ -178,4 +182,3 @@ impl From for FatcatError { FatcatError::InternalError(error.to_string()) } } - -- cgit v1.2.3