Replace usage of io::Error::new(io::ErrorKind::Other, with io::Error::other

Newly possible with Rust 1.74.
This commit is contained in:
Luke Parker
2023-11-19 18:01:13 -05:00
parent 05b975dff9
commit 797604ad73
25 changed files with 114 additions and 154 deletions

View File

@@ -125,7 +125,7 @@ pub trait Curve: Ciphersuite {
fn read_G<R: Read>(reader: &mut R) -> io::Result<Self::G> {
let res = <Self as Ciphersuite>::read_G(reader)?;
if res.is_identity().into() {
Err(io::Error::new(io::ErrorKind::Other, "identity point"))?;
Err(io::Error::other("identity point"))?;
}
Ok(res)
}

View File

@@ -223,7 +223,7 @@ impl<C: Curve> Commitments<C> {
let dleq = MultiDLEqProof::read(reader, dleq_generators.len())?;
dleq
.verify(&mut dleq_transcript::<T>(context), &dleq_generators, &dleq_nonces)
.map_err(|_| io::Error::new(io::ErrorKind::Other, "invalid DLEq proof"))?;
.map_err(|_| io::Error::other("invalid DLEq proof"))?;
Some(dleq)
} else {
None