From 0d0b43ed8819e66a0888eb6d1d1f47b171ae62e0 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 7 Feb 2022 19:29:52 +0300 Subject: fix(users/tazjin): rustfmt code with non-default settings rustfmt only sometimes detects path-based nested config files (probably some kind of race?), so my users folder uses a separate formatting check for rustfmt to avoid flaky CI. Enough flakes around already ... Change-Id: Ifd862f9974f071b3a256643dd8e56c019116156a Reviewed-on: https://cl.tvl.fyi/c/depot/+/5242 Reviewed-by: tazjin Autosubmit: tazjin Tested-by: BuildkiteCI --- users/tazjin/finito/finito-postgres/src/error.rs | 26 +++++++++--------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'users/tazjin/finito/finito-postgres/src/error.rs') diff --git a/users/tazjin/finito/finito-postgres/src/error.rs b/users/tazjin/finito/finito-postgres/src/error.rs index e130d18361..ed33775cd7 100644 --- a/users/tazjin/finito/finito-postgres/src/error.rs +++ b/users/tazjin/finito/finito-postgres/src/error.rs @@ -1,10 +1,9 @@ //! This module defines error types and conversions for issue that can //! occur while dealing with persisted state machines. -use std::result; -use std::fmt; -use uuid::Uuid; use std::error::Error as StdError; +use std::{fmt, result}; +use uuid::Uuid; // errors to chain: use postgres::Error as PgError; @@ -41,20 +40,15 @@ impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { use ErrorKind::*; let msg = match &self.kind { - Serialization(err) => - format!("JSON serialization error: {}", err), + Serialization(err) => format!("JSON serialization error: {}", err), - Database(err) => - format!("PostgreSQL error: {}", err), + Database(err) => format!("PostgreSQL error: {}", err), - DBPool(err) => - format!("Database connection pool error: {}", err), + DBPool(err) => format!("Database connection pool error: {}", err), - FSMNotFound(id) => - format!("FSM with ID {} not found", id), + FSMNotFound(id) => format!("FSM with ID {} not found", id), - ActionNotFound(id) => - format!("Action with ID {} not found", id), + ActionNotFound(id) => format!("Action with ID {} not found", id), }; match &self.context { @@ -66,7 +60,7 @@ impl fmt::Display for Error { impl StdError for Error {} -impl > From for Error { +impl> From for Error { fn from(err: E) -> Error { Error { kind: err.into(), @@ -99,11 +93,11 @@ pub trait ResultExt { fn context(self, ctx: C) -> Result; } -impl > ResultExt for result::Result { +impl> ResultExt for result::Result { fn context(self, ctx: C) -> Result { self.map_err(|err| Error { context: Some(format!("{}", ctx)), - .. err.into() + ..err.into() }) } } -- cgit 1.4.1