(clippy) More idomatic reference matching.
This commit is contained in:
parent
19efad5ba6
commit
9e5f70f126
24
src/lib.rs
24
src/lib.rs
@ -404,16 +404,16 @@ pub enum PrimeFieldDecodingError {
|
|||||||
|
|
||||||
impl Error for PrimeFieldDecodingError {
|
impl Error for PrimeFieldDecodingError {
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
match self {
|
match *self {
|
||||||
&PrimeFieldDecodingError::NotInField(..) => "not an element of the field"
|
PrimeFieldDecodingError::NotInField(..) => "not an element of the field"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for PrimeFieldDecodingError {
|
impl fmt::Display for PrimeFieldDecodingError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||||
match self {
|
match *self {
|
||||||
&PrimeFieldDecodingError::NotInField(ref repr) => {
|
PrimeFieldDecodingError::NotInField(ref repr) => {
|
||||||
write!(f, "{} is not an element of the field", repr)
|
write!(f, "{} is not an element of the field", repr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -437,20 +437,20 @@ pub enum GroupDecodingError {
|
|||||||
|
|
||||||
impl Error for GroupDecodingError {
|
impl Error for GroupDecodingError {
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
match self {
|
match *self {
|
||||||
&GroupDecodingError::NotOnCurve => "coordinate(s) do not lie on the curve",
|
GroupDecodingError::NotOnCurve => "coordinate(s) do not lie on the curve",
|
||||||
&GroupDecodingError::NotInSubgroup => "the element is not part of an r-order subgroup",
|
GroupDecodingError::NotInSubgroup => "the element is not part of an r-order subgroup",
|
||||||
&GroupDecodingError::CoordinateDecodingError(..) => "coordinate(s) could not be decoded",
|
GroupDecodingError::CoordinateDecodingError(..) => "coordinate(s) could not be decoded",
|
||||||
&GroupDecodingError::UnexpectedCompressionMode => "encoding has unexpected compression mode",
|
GroupDecodingError::UnexpectedCompressionMode => "encoding has unexpected compression mode",
|
||||||
&GroupDecodingError::UnexpectedInformation => "encoding has unexpected information"
|
GroupDecodingError::UnexpectedInformation => "encoding has unexpected information"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for GroupDecodingError {
|
impl fmt::Display for GroupDecodingError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
|
||||||
match self {
|
match *self {
|
||||||
&GroupDecodingError::CoordinateDecodingError(description, ref err) => {
|
GroupDecodingError::CoordinateDecodingError(description, ref err) => {
|
||||||
write!(f, "{} decoding error: {}", description, err)
|
write!(f, "{} decoding error: {}", description, err)
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
|
Loading…
Reference in New Issue
Block a user