diff --git a/node/rest/src/lib.rs b/node/rest/src/lib.rs index 38b7c28478..17881a5116 100644 --- a/node/rest/src/lib.rs +++ b/node/rest/src/lib.rs @@ -110,21 +110,21 @@ impl, R: Routing> Rest { // Prepare the rate limiting setup. let governor_config = Box::new( - GovernorConfigBuilder::default() - .per_nanosecond((1_000_000_000 / rest_rps) as u64) - .burst_size(rest_rps) - .error_handler(|error| { - // Properly return a 429 Too Many Requests error - let error_message = error.to_string(); - let mut response = Response::new(error_message.clone().into()); - *response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR; - if error_message.contains("Too Many Requests") { - *response.status_mut() = StatusCode::TOO_MANY_REQUESTS; - } - response - }) - .finish() - .expect("Couldn't set up rate limiting for the REST server!"), + GovernorConfigBuilder::default() + .per_nanosecond((1_000_000_000 / rest_rps) as u64) + .burst_size(rest_rps) + .error_handler(|error| { + // Properly return a 429 Too Many Requests error + let error_message = error.to_string(); + let mut response = Response::new(error_message.clone().into()); + *response.status_mut() = StatusCode::INTERNAL_SERVER_ERROR; + if error_message.contains("Too Many Requests") { + *response.status_mut() = StatusCode::TOO_MANY_REQUESTS; + } + response + }) + .finish() + .expect("Couldn't set up rate limiting for the REST server!"), ); // Get the network being used. diff --git a/node/router/src/heartbeat.rs b/node/router/src/heartbeat.rs index 63f0f0ddd8..7b5477302d 100644 --- a/node/router/src/heartbeat.rs +++ b/node/router/src/heartbeat.rs @@ -21,7 +21,7 @@ use crate::{ use snarkvm::prelude::Network; use colored::Colorize; -use rand::{prelude::IteratorRandom, rngs::OsRng, Rng}; +use rand::{Rng, prelude::IteratorRandom, rngs::OsRng}; /// A helper function to compute the maximum of two numbers. /// See Rust issue 92391: https://github.com/rust-lang/rust/issues/92391.