diff --git a/crates/miroir-proxy/src/routes/search_ui.rs b/crates/miroir-proxy/src/routes/search_ui.rs index afc0370..734f288 100644 --- a/crates/miroir-proxy/src/routes/search_ui.rs +++ b/crates/miroir-proxy/src/routes/search_ui.rs @@ -700,12 +700,11 @@ fn validate_template(template: &str) -> Result<(), ErrorResponse> { if_stack.push("if"); } // Check for {{/if}} closing - else if tag.starts_with("/if") - && if_stack.pop() != Some("if") { - return Err(ErrorResponse::invalid_request( - "unmatched {{/if}} tag in template".to_string(), - )); - } + else if tag.starts_with("/if") && if_stack.pop() != Some("if") { + return Err(ErrorResponse::invalid_request( + "unmatched {{/if}} tag in template".to_string(), + )); + } pos += end + 2; } else { @@ -716,7 +715,9 @@ fn validate_template(template: &str) -> Result<(), ErrorResponse> { } if !if_stack.is_empty() { - return Err(ErrorResponse::invalid_request("unclosed {#if} tag in template".to_string())); + return Err(ErrorResponse::invalid_request( + "unclosed {#if} tag in template".to_string(), + )); } Ok(()) diff --git a/crates/miroir-proxy/src/scoped_key_rotation.rs b/crates/miroir-proxy/src/scoped_key_rotation.rs index bd6e616..6e5bf97 100644 --- a/crates/miroir-proxy/src/scoped_key_rotation.rs +++ b/crates/miroir-proxy/src/scoped_key_rotation.rs @@ -111,16 +111,15 @@ pub async fn check_and_rotate( .map_err(|e| format!("redis read failed: {e}"))?; // Timing gate check (skip if force) - if !force - && !should_rotate(¤t, &state.config) { - return Ok(RotateScopedKeyResponse { - status: "skipped".into(), - index_uid: index_uid.into(), - generation: current.as_ref().map(|k| k.generation).unwrap_or(0), - previous_uid_revoked: None, - error: None, - }); - } + if !force && !should_rotate(¤t, &state.config) { + return Ok(RotateScopedKeyResponse { + status: "skipped".into(), + index_uid: index_uid.into(), + generation: current.as_ref().map(|k| k.generation).unwrap_or(0), + previous_uid_revoked: None, + error: None, + }); + } // Step 1: Mint new scoped key via Meilisearch POST /keys let client = MeilisearchClient::new(state.config.node_master_key.clone());