Skip to content

Commit

Permalink
chore: fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed May 14, 2023
1 parent 72bfcfd commit 735d289
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion commit_verify/derive/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl TryFrom<&Path> for StrategyAttr {
}

impl StrategyAttr {
pub fn to_ident(&self) -> Ident {
pub fn to_ident(self) -> Ident {
match self {
StrategyAttr::CommitEncoding => {
panic!("StrategyAttr::CommitEncoding must be derived manually")
Expand Down
2 changes: 2 additions & 0 deletions commit_verify/derive/tests/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ fn strategy_transparent() -> common::Result {
struct ShortLen(u16);

verify_commit(ShortLen(0), [0, 0]);
#[allow(clippy::mixed_case_hex_literals)]
verify_commit(ShortLen(0xFFde), [0xde, 0xFF]);

Ok(())
Expand All @@ -69,6 +70,7 @@ fn strategy_into_u8() -> common::Result {
B,
C,
}
#[allow(clippy::from_over_into)]
impl Into<u8> for Prim {
fn into(self) -> u8 { self as u8 }
}
Expand Down
2 changes: 1 addition & 1 deletion commit_verify/src/convolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ where
where
Self: VerifyEq,
{
let original = self.restore_original(&commitment);
let original = self.restore_original(commitment);
let suppl = self.extract_supplement();
let (commitment_prime, proof) = original.convolve_commit(suppl, msg)?;
Ok(commitment.verify_eq(&commitment_prime) && self.verify_eq(&proof))
Expand Down
4 changes: 2 additions & 2 deletions commit_verify/src/embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ where
{
let mut container_prime = proof.restore_original_container(self)?;
let proof_prime = container_prime.embed_commit(msg)?;
Ok(proof_prime.verify_eq(&proof) && self.verify_eq(&container_prime))
Ok(proof_prime.verify_eq(proof) && self.verify_eq(&container_prime))
}

/// Phantom method used to add `Protocol` generic parameter to the trait.
Expand Down Expand Up @@ -264,7 +264,7 @@ pub(crate) mod test_helpers {
acc.iter().for_each(|commitment| {
// Testing that verification against other commitments
// returns `false`
assert!(!SUPPLEMENT.verify(msg, &commitment).unwrap());
assert!(!SUPPLEMENT.verify(msg, commitment).unwrap());
});

// Detecting collision: each message should produce a unique
Expand Down
2 changes: 1 addition & 1 deletion commit_verify/src/mpc/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl From<&MerkleTree> for MerkleBlock {
fn from(tree: &MerkleTree) -> Self {
let map = &tree.map;

let iter = (0..tree.width()).into_iter().map(|pos| {
let iter = (0..tree.width()).map(|pos| {
map.get(&pos)
.map(|(protocol_id, message)| TreeNode::CommitmentLeaf {
protocol_id: *protocol_id,
Expand Down
2 changes: 1 addition & 1 deletion commit_verify/src/mpc/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl CommitmentId for MerkleTree {

impl MerkleTree {
pub fn root(&self) -> MerkleNode {
let iter = (0..self.width()).into_iter().map(|pos| {
let iter = (0..self.width()).map(|pos| {
self.map
.get(&pos)
.map(|(protocol, msg)| Leaf::inhabited(*protocol, *msg))
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
//! standardizing typical workflow processes in a form of interfaces that
//! will be nearly impossible to use in a wrong way.
#[allow(missing_docs)]
/// Re-export of `commit_verify` crate.
pub extern crate commit_verify as commit;
#[allow(missing_docs)]
/// Re-export of `single_use_seals` crate.
pub extern crate single_use_seals as seals;

#[cfg(feature = "serde")]
Expand Down

0 comments on commit 735d289

Please sign in to comment.