From 9e5f70f12614071b497209d06cd72a8f9bc2abf3 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Tue, 18 Jul 2017 10:16:49 -0600 Subject: [PATCH] (clippy) More idomatic reference matching. --- src/lib.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 326e436..04bde0f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -404,16 +404,16 @@ pub enum PrimeFieldDecodingError { impl Error for PrimeFieldDecodingError { fn description(&self) -> &str { - match self { - &PrimeFieldDecodingError::NotInField(..) => "not an element of the field" + match *self { + PrimeFieldDecodingError::NotInField(..) => "not an element of the field" } } } impl fmt::Display for PrimeFieldDecodingError { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - match self { - &PrimeFieldDecodingError::NotInField(ref repr) => { + match *self { + PrimeFieldDecodingError::NotInField(ref repr) => { write!(f, "{} is not an element of the field", repr) } } @@ -437,20 +437,20 @@ pub enum GroupDecodingError { impl Error for GroupDecodingError { fn description(&self) -> &str { - match self { - &GroupDecodingError::NotOnCurve => "coordinate(s) do not lie on the curve", - &GroupDecodingError::NotInSubgroup => "the element is not part of an r-order subgroup", - &GroupDecodingError::CoordinateDecodingError(..) => "coordinate(s) could not be decoded", - &GroupDecodingError::UnexpectedCompressionMode => "encoding has unexpected compression mode", - &GroupDecodingError::UnexpectedInformation => "encoding has unexpected information" + match *self { + GroupDecodingError::NotOnCurve => "coordinate(s) do not lie on the curve", + GroupDecodingError::NotInSubgroup => "the element is not part of an r-order subgroup", + GroupDecodingError::CoordinateDecodingError(..) => "coordinate(s) could not be decoded", + GroupDecodingError::UnexpectedCompressionMode => "encoding has unexpected compression mode", + GroupDecodingError::UnexpectedInformation => "encoding has unexpected information" } } } impl fmt::Display for GroupDecodingError { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { - match self { - &GroupDecodingError::CoordinateDecodingError(description, ref err) => { + match *self { + GroupDecodingError::CoordinateDecodingError(description, ref err) => { write!(f, "{} decoding error: {}", description, err) }, _ => {