Skip to content

Commit

Permalink
Fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraSuegami committed Dec 2, 2024
1 parent 35ca3cd commit ad40303
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/relayer/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub fn parse_command_template(template: &str, params: Vec<String>) -> String {
let mut parsed_string = template.to_string();
let mut param_iter = params.iter();

#[allow(clippy::while_let_on_iterator)]
while let Some(value) = param_iter.next() {
if let Some(start) = parsed_string.find('{') {
if let Some(end) = parsed_string[start..].find('}') {
Expand Down
4 changes: 2 additions & 2 deletions packages/relayer/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub async fn submit_handler(

// Determine the account code if it exists in the email
let account_code = if body.code_exists_in_email {
let hex_code = field_to_hex(&body.account_code.clone().0);
let hex_code = field_to_hex(&body.account_code.0);
Some(hex_code.trim_start_matches("0x").to_string())
} else {
None
Expand Down Expand Up @@ -121,7 +121,7 @@ pub async fn submit_handler(
});

// Return the success response
return Ok((StatusCode::OK, Json(response)));
Ok((StatusCode::OK, Json(response)))
}

/// Handles the reception of an email and processes it accordingly.
Expand Down
4 changes: 2 additions & 2 deletions packages/relayer/src/mail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ pub async fn handle_email(
// Return a completion event with transaction details
Ok(EmailEvent::Completion {
email_addr: parsed_email.get_from_addr()?,
request_id: request.id.clone(),
request_id: request.id,
original_subject: parsed_email.get_subject_all()?,
original_message_id: parsed_email.get_message_id().ok(),
explorer_url,
Expand All @@ -435,7 +435,7 @@ async fn get_email_auth_msg(
let email_proof = generate_email_proof(email, request.clone(), relayer_state).await?;
info!(LOG, "Email proof generated");
let email_auth_msg = EmailAuthMsg {
template_id: request.email_tx_auth.template_id.into(),
template_id: request.email_tx_auth.template_id,
command_params: command_params_encoded,
skipped_command_prefix: U256::zero(),
proof: email_proof,
Expand Down
6 changes: 3 additions & 3 deletions packages/relayer/src/prove.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ pub async fn generate_email_proof(
update_request(&relayer_state.db, request.id, RequestStatus::Proving).await?;

// Parse the email from the raw content
let parsed_email = ParsedEmail::new_from_raw_email(&email).await?;
let parsed_email = ParsedEmail::new_from_raw_email(email).await?;

// Generate the circuit input for the email proof
let circuit_input = generate_email_circuit_input(
&email,
email,
&request.email_tx_auth.account_code,
Some(EmailCircuitParams {
max_header_length: Some(1024),
Expand Down Expand Up @@ -75,7 +75,7 @@ pub async fn generate_email_proof(
let email_proof = EmailProof {
proof,
domain_name: parsed_email.get_email_domain()?,
public_key_hash: u256_to_bytes32(&public_signals[DOMAIN_FIELDS + 0]),
public_key_hash: u256_to_bytes32(&public_signals[DOMAIN_FIELDS]),
timestamp: u256_to_bytes32(&public_signals[DOMAIN_FIELDS + 2]).into(),
masked_command,
email_nullifier: u256_to_bytes32(&public_signals[DOMAIN_FIELDS + 1]),
Expand Down

0 comments on commit ad40303

Please sign in to comment.