diff --git a/bobbin/crates/xrpc/src/profile_activity.rs b/bobbin/crates/xrpc/src/profile_activity.rs
index 80e34174b..263467910 100644
--- a/bobbin/crates/xrpc/src/profile_activity.rs
+++ b/bobbin/crates/xrpc/src/profile_activity.rs
@@ -4,12 +4,12 @@ use axum::{extract::State, response::Json};
use bobbin_edge_index::{EdgeItem, EdgeStore, PageCursor, PageLimit, SortDir};
use bobbin_types::edges::{TICKET_PULL_KIND, ticket_kind};
use bobbin_types::ids::{EdgeKey, SubjectRef, nsid_static, owner_did_from_aturi};
-use bobbin_types::org_tangled::repo::manifest::{Manifest, ManifestRecord};
-use bobbin_types::org_tangled::track::ticket::{Ticket, TicketRecord};
use bobbin_types::org_tangled::actor::get_profile_activity::{
ActivityMonth, GetProfileActivityOutput, IssueActivity, PullActivity, RepoActivity,
RepoActivityKind, RepoRef,
};
+use bobbin_types::org_tangled::repo::manifest::{Manifest, ManifestRecord};
+use bobbin_types::org_tangled::track::ticket::{Ticket, TicketRecord};
use chrono::{DateTime, TimeZone, Utc};
use futures::{StreamExt, stream};
use jacquard_common::DefaultStr;
diff --git a/bobbin/crates/xrpc/tests/coverage.rs b/bobbin/crates/xrpc/tests/coverage.rs
index 9e01830a3..d91e6695b 100644
--- a/bobbin/crates/xrpc/tests/coverage.rs
+++ b/bobbin/crates/xrpc/tests/coverage.rs
@@ -319,7 +319,10 @@ async fn any_origin_allows_preflight_and_get() {
}
fn ready_request() -> Request
{
- Request::builder().uri("/_ready").body(Body::empty()).unwrap()
+ Request::builder()
+ .uri("/_ready")
+ .body(Body::empty())
+ .unwrap()
}
#[tokio::test]
diff --git a/crates/gix-chunk/src/file/decode.rs b/crates/gix-chunk/src/file/decode.rs
index 498a66872..1ad3f952b 100644
--- a/crates/gix-chunk/src/file/decode.rs
+++ b/crates/gix-chunk/src/file/decode.rs
@@ -7,7 +7,11 @@ use crate::{file, file::index};
impl file::Index {
/// Provided a mapped file at the beginning via `data`, starting at `toc_offset` decode all chunk information to return
/// an index with `num_chunks` chunks.
- pub fn from_bytes(data: &[u8], toc_offset: usize, num_chunks: u32) -> Result {
+ pub fn from_bytes(
+ data: &[u8],
+ toc_offset: usize,
+ num_chunks: u32,
+ ) -> Result {
if num_chunks == 0 {
return Err(ValidationError::new(
"Empty chunk indices are not allowed as the point of chunked files is to have chunks.",
@@ -67,7 +71,10 @@ impl file::Index {
let sentinel = to_kind(&toc_entry[..4]);
if sentinel != crate::SENTINEL {
- Err(format!("Sentinel value wasn't found, saw '{}'", sentinel.as_bstr()))?;
+ Err(format!(
+ "Sentinel value wasn't found, saw '{}'",
+ sentinel.as_bstr()
+ ))?;
}
Ok(file::Index {
diff --git a/crates/gix-chunk/src/file/index.rs b/crates/gix-chunk/src/file/index.rs
index f2ead63d1..1f017fb95 100644
--- a/crates/gix-chunk/src/file/index.rs
+++ b/crates/gix-chunk/src/file/index.rs
@@ -42,7 +42,9 @@ impl Index {
pub fn usize_offset_by_id(&self, kind: Id) -> Result, Message> {
self.chunks
.iter()
- .find_map(|c| (c.kind == kind).then(|| crate::range::into_usize_or_panic(c.offset.clone())))
+ .find_map(|c| {
+ (c.kind == kind).then(|| crate::range::into_usize_or_panic(c.offset.clone()))
+ })
.ok_or_else(make_message(kind))
}
@@ -54,7 +56,9 @@ impl Index {
) -> Result {
self.chunks
.iter()
- .find_map(|c| (c.kind == kind).then(|| crate::range::into_usize_or_panic(c.offset.clone())))
+ .find_map(|c| {
+ (c.kind == kind).then(|| crate::range::into_usize_or_panic(c.offset.clone()))
+ })
.map(validate)
.ok_or_else(make_message(kind))
}
@@ -62,8 +66,9 @@ impl Index {
/// Find a chunk of `kind` and return its data slice based on its offset.
pub fn data_by_id<'a>(&self, data: &'a [u8], kind: Id) -> Result<&'a [u8], Message> {
let offset = self.offset_by_id(kind)?;
- Ok(&data[crate::range::into_usize(offset)
- .ok_or_else(|| message("The offsets into the file couldn't be represented by usize"))?])
+ Ok(&data[crate::range::into_usize(offset).ok_or_else(|| {
+ message("The offsets into the file couldn't be represented by usize")
+ })?])
}
/// Return the end offset of the last chunk, which is the highest offset as well.
@@ -74,5 +79,10 @@ impl Index {
}
fn make_message(kind: Id) -> impl FnOnce() -> Message {
- move || message!("Chunk named '{}' was not found in chunk file index", kind.as_bstr())
+ move || {
+ message!(
+ "Chunk named '{}' was not found in chunk file index",
+ kind.as_bstr()
+ )
+ }
}
diff --git a/crates/gix-chunk/src/file/write.rs b/crates/gix-chunk/src/file/write.rs
index 42dbac0dc..ccbbf5621 100644
--- a/crates/gix-chunk/src/file/write.rs
+++ b/crates/gix-chunk/src/file/write.rs
@@ -80,7 +80,10 @@ impl Index {
}
/// Plan to write a new chunk as part of the index when [`into_write()`][Index::into_write()] is called.
pub fn plan_chunk(&mut self, chunk: crate::Id, exact_size_on_disk: u64) {
- assert!(self.will_write, "BUG: create the index with `for_writing()`");
+ assert!(
+ self.will_write,
+ "BUG: create the index with `for_writing()`"
+ );
assert!(
!self.chunks.iter().any(|e| e.kind == chunk),
"BUG: must not add chunk of same kind twice: {chunk:?}"
@@ -93,7 +96,10 @@ impl Index {
/// Return the total size of all planned chunks thus far.
pub fn planned_storage_size(&self) -> u64 {
- assert!(self.will_write, "BUG: create the index with `for_writing()`");
+ assert!(
+ self.will_write,
+ "BUG: create the index with `for_writing()`"
+ );
self.chunks.iter().map(|e| e.offset.end).sum()
}
@@ -114,7 +120,8 @@ impl Index {
"BUG: create the index with `for_writing()`, cannot write decoded indices"
);
// First chunk starts past the table of contents
- let mut current_offset = (current_offset + Self::size_for_entries(self.num_chunks())) as u64;
+ let mut current_offset =
+ (current_offset + Self::size_for_entries(self.num_chunks())) as u64;
for entry in &self.chunks {
out.write_all(&entry.kind)?;
diff --git a/crates/gix-commitgraph/src/access.rs b/crates/gix-commitgraph/src/access.rs
index cf30e3f64..5f4bdd3fd 100644
--- a/crates/gix-commitgraph/src/access.rs
+++ b/crates/gix-commitgraph/src/access.rs
@@ -55,7 +55,10 @@ impl Graph {
/// Return changed-path Bloom filter settings used by the top-most compatible graph layer, if available.
pub fn bloom_filter_settings(&self) -> Option {
- self.files.iter().rev().find_map(File::bloom_filter_settings)
+ self.files
+ .iter()
+ .rev()
+ .find_map(File::bloom_filter_settings)
}
}
diff --git a/crates/gix-commitgraph/src/bloom.rs b/crates/gix-commitgraph/src/bloom.rs
index df707a43e..f14e7e82c 100644
--- a/crates/gix-commitgraph/src/bloom.rs
+++ b/crates/gix-commitgraph/src/bloom.rs
@@ -46,7 +46,9 @@ impl BloomKey {
let (h0, h1) = match settings.hash_version {
1 => (murmur3_v1(SEED0, path), murmur3_v1(SEED1, path)),
2 => (murmur3_v2(SEED0, path), murmur3_v2(SEED1, path)),
- version => panic!("BUG: unsupported Bloom hash version {version} should have been filtered earlier"),
+ version => panic!(
+ "BUG: unsupported Bloom hash version {version} should have been filtered earlier"
+ ),
};
Self {
h0,
@@ -148,7 +150,11 @@ impl File {
impl Graph {
/// Query by commit id if `path` may be present in changed-path Bloom filters.
- pub fn maybe_contains_path_by_id(&self, id: impl AsRef, path: &BStr) -> Option {
+ pub fn maybe_contains_path_by_id(
+ &self,
+ id: impl AsRef,
+ path: &BStr,
+ ) -> Option {
let pos = self.lookup(id)?;
self.maybe_contains_path(pos, path)
}
diff --git a/crates/gix-commitgraph/src/file/access.rs b/crates/gix-commitgraph/src/file/access.rs
index cf5b580e9..94fbd2b6f 100644
--- a/crates/gix-commitgraph/src/file/access.rs
+++ b/crates/gix-commitgraph/src/file/access.rs
@@ -54,7 +54,8 @@ impl File {
/// Return an iterator over all object hashes stored in the base graph.
pub fn iter_base_graph_ids(&self) -> impl Iterator- {
let start = self.base_graphs_list_offset.unwrap_or(0);
- let base_graphs_list = &self.data[start..][..self.hash_len * usize::from(self.base_graph_count)];
+ let base_graphs_list =
+ &self.data[start..][..self.hash_len * usize::from(self.base_graph_count)];
base_graphs_list
.chunks_exact(self.hash_len)
.map(gix_hash::oid::from_bytes_unchecked)
@@ -79,7 +80,11 @@ impl File {
fn lookup_inner(&self, id: &gix_hash::oid) -> Option {
let first_byte = usize::from(id.first_byte());
let mut upper_bound = self.fan[first_byte];
- let mut lower_bound = if first_byte != 0 { self.fan[first_byte - 1] } else { 0 };
+ let mut lower_bound = if first_byte != 0 {
+ self.fan[first_byte - 1]
+ } else {
+ 0
+ };
while lower_bound < upper_bound {
let mid = u32::midpoint(lower_bound, upper_bound);
diff --git a/crates/gix-commitgraph/src/file/commit.rs b/crates/gix-commitgraph/src/file/commit.rs
index f20fdf5f5..e3db867b0 100644
--- a/crates/gix-commitgraph/src/file/commit.rs
+++ b/crates/gix-commitgraph/src/file/commit.rs
@@ -2,7 +2,10 @@
use crate::{
File, Position,
bloom::BloomKey,
- file::{self, CORRECTED_COMMIT_DATE_OFFSET_OVERFLOW, EXTENDED_EDGES_MASK, LAST_EXTENDED_EDGE_MASK, NO_PARENT},
+ file::{
+ self, CORRECTED_COMMIT_DATE_OFFSET_OVERFLOW, EXTENDED_EDGES_MASK, LAST_EXTENDED_EDGE_MASK,
+ NO_PARENT,
+ },
from_be_u32,
};
use bstr::BStr;
@@ -35,8 +38,9 @@ impl<'a> Commit<'a> {
parent1: ParentEdge::from_raw(from_be_u32(&bytes[file.hash_len..][..4])),
parent2: ParentEdge::from_raw(from_be_u32(&bytes[file.hash_len + 4..][..4])),
generation: from_be_u32(&bytes[file.hash_len + 8..][..4]) >> 2,
- commit_timestamp: u64::from_be_bytes(bytes[file.hash_len + 8..][..8].try_into().unwrap())
- & 0x0003_ffff_ffff,
+ commit_timestamp: u64::from_be_bytes(
+ bytes[file.hash_len + 8..][..8].try_into().unwrap(),
+ ) & 0x0003_ffff_ffff,
}
}
@@ -61,7 +65,10 @@ impl<'a> Commit<'a> {
/// It is the larger of this commit's committer timestamp and its parents' corrected commit dates plus one.
pub fn corrected_commit_date(&self) -> Result