Skip to content

Commit

Permalink
Merge pull request #946 from akoshelev/rust-176
Browse files Browse the repository at this point in the history
Fix clippy lint violations that appeared after upgrading to Rust 1.76
  • Loading branch information
akoshelev authored Feb 8, 2024
2 parents 8cfc2a2 + 0cc0922 commit 2a1f521
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ipa-core/src/net/server/handlers/query/prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::{
/// processing of that query.
async fn handler(
transport: Extension<Arc<HttpTransport>>,
_from: Extension<ClientIdentity>, // require that client is an authenticated helper
_: Extension<ClientIdentity>, // require that client is an authenticated helper
req: http_serde::query::prepare::Request,
) -> Result<(), PrepareQueryError> {
Arc::clone(&transport).prepare_query(req.data).await
Expand Down
17 changes: 4 additions & 13 deletions ipa-core/src/protocol/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,33 +290,24 @@ mod tests {
test_fixture::{Reconstruct, Runner, TestWorld, TestWorldConfig},
};

trait AsReplicatedTestOnly<F: Field> {
trait ReplicatedLeftValue<F: Field> {
fn l(&self) -> F;
fn r(&self) -> F;
}

impl<F: Field> AsReplicatedTestOnly<F> for Replicated<F> {
impl<F: Field> ReplicatedLeftValue<F> for Replicated<F> {
fn l(&self) -> F {
(self as &Replicated<F>).left()
}

fn r(&self) -> F {
(self as &Replicated<F>).right()
}
}

/// This looks weird because it uses `MaliciousReplicated::rx()` value instead of `x`.
/// Malicious context intentionally disallows access to `x` without validating first and
/// here it does not matter at all. It needs just some value to send (any value would do just
/// fine)
impl<F: ExtendableField> AsReplicatedTestOnly<F::ExtendedField> for MaliciousReplicated<F> {
impl<F: ExtendableField> ReplicatedLeftValue<F::ExtendedField> for MaliciousReplicated<F> {
fn l(&self) -> F::ExtendedField {
(self as &MaliciousReplicated<F>).rx().left()
}

fn r(&self) -> F::ExtendedField {
(self as &MaliciousReplicated<F>).rx().right()
}
}

/// Toy protocol to execute PRSS generation and send/receive logic
Expand All @@ -325,7 +316,7 @@ mod tests {
F: Field,
Standard: Distribution<F>,
C: Context,
S: AsReplicatedTestOnly<F>,
S: ReplicatedLeftValue<F>,
{
let ctx = ctx.narrow("metrics");
let (left_peer, right_peer) = (
Expand Down

0 comments on commit 2a1f521

Please sign in to comment.