chore: Format code

This commit is contained in:
Tyler Beckman 2024-10-28 17:42:42 -06:00
parent c46dfd4457
commit 27e5aaa777
Signed by: Ty
GPG key ID: 2813440C772555A4
2 changed files with 11 additions and 11 deletions

View file

@ -53,7 +53,7 @@ pub struct GetProofByHashResponse {
}
/// A response given when fetching CT log entries within a range
///
///
/// See: [`super::endpoints::GET_ENTRIES`]
#[derive(Debug, Deserialize)]
pub struct GetEntriesResponse {
@ -65,4 +65,4 @@ pub struct GetEntriesResponse {
pub struct GetEntriesResponseEntry {
pub leaf_input: String,
pub extra_data: String
}
}

View file

@ -2,26 +2,26 @@ use std::sync::Arc;
use base64ct::Encoding;
use ct::{
api::{responses::GetEntriesResponseEntry, CtApiClient}, merkle::{
api::{responses::GetEntriesResponseEntry, CtApiClient},
merkle::{
consts::EXTRA_DATA_BASE64_BUFFER_SIZE,
types::{MerkleLeafType, Version}
}, parsing::entry::{parse_entry_extra_data_precert, parse_entry_extra_data_x509}
},
parsing::entry::{parse_entry_extra_data_precert, parse_entry_extra_data_x509}
};
use tokio::task::JoinSet;
async fn fetch_entries() -> impl Iterator<Item = GetEntriesResponseEntry> {
let client = Arc::new(
CtApiClient::new_with_client(
"https://oak.ct.letsencrypt.org/2024h2/ct/v1/get-entries",
Arc::new(reqwest::Client::new())
)
);
let client = Arc::new(CtApiClient::new_with_client(
"https://oak.ct.letsencrypt.org/2024h2/ct/v1/get-entries",
Arc::new(reqwest::Client::new())
));
let mut join_set: JoinSet<_> = JoinSet::new();
for i in 0..12u64 {
let client = client.clone();
join_set.spawn(async move {
client
.get_log_entries(i * 256, (i+1) * 256 - 1)
.get_log_entries(i * 256, (i + 1) * 256 - 1)
.await
.expect("Request should succeed")
});