gate: apply rustfmt to the migrated kernel sources
commit
39dd599gate: apply rustfmt to the migrated kernel sources
Assisted-by: Claude:claude-opus-4-8
Reviews
No reviews of this commit yet — record a verdict below.
Start a review
crates/kernel/ents-gate/src/lib.rs
@@ -123,13 +123,17 @@
//! let issue = Issue {
//! title: "t".into(), body: "b".into(), state: "open".into(),
//! };
-//! let name: gix::refs::FullName = "refs/meta/issues/1".try_into().expect("valid");
-//! let tip = write_meta_entity(&refs, &objects, name.clone(), &issue, Some(&key), 300);
+//! // A hash-identified entity's id is its genesis commit's own oid, so the
+//! // ref is named from the signed commit (`meta-ref.identity-binding`).
+//! let tree = facet_git_tree::serialize_into(&issue, &objects).expect("serializes");
+//! let tip = ents_testutil::write_commit(&objects, &ents_testutil::CommitSpec {
+//! tree, parents: vec![], message: "Open an issue".into(), seconds: 300,
+//! }, Some(&key));
+//! let name: gix::refs::FullName = format!("refs/meta/issues/{tip}").try_into().expect("valid");
//!
-//! // The fixture already moved the ref; judge the same tip as a proposal
-//! // against a pre-push copy of the store, the way pre-flight would.
+//! // Judge the tip as a proposal against a store that does not yet have
+//! // the ref, the way hosted CAS or pre-flight would.
//! let before = refs.fetched_copy();
-//! before.remove(name.as_ref());
//! let verdict = verify(&before, &objects, &Update { name, new: Some(tip) })
//! .expect("evaluates");
//! let Verdict::Pass(admission) = verdict else { panic!("authorized update passes") };
crates/kernel/ents-gate/src/verify.rs
@@ -248,8 +248,7 @@
// the member its refname names. Creation stays provenance-keyed,
// already judged by `authorize` above.
// @relation(gate.owner-mutation, scope=function)
- if let Some(refusal) =
- owner_mutation(objects, &update.name, old, new, &members, &id, &member)?
+ if let Some(refusal) = owner_mutation(objects, &update.name, old, new, &members, &id, &member)?
{
return Ok(Verdict::Fail(refusal));
}
@@ -455,8 +454,7 @@
/// The value of a scalar tree field as UTF-8, or `None` if the entry is
/// absent or not valid UTF-8.
fn field_str(objects: &dyn Find, tree: ObjectId, field: &str) -> Result<Option<String>> {
- Ok(read_tree_entry(objects, tree, field)?
- .and_then(|bytes| String::from_utf8(bytes).ok()))
+ Ok(read_tree_entry(objects, tree, field)?.and_then(|bytes| String::from_utf8(bytes).ok()))
}
/// The hex form of a raw-oid (`[u8; 20]`) tree field, or `None` when the
@@ -497,7 +495,10 @@
)),
None => Ok(binding_refusal(
name,
- format!("the tree carries no `{field}` field to bind {}", name.as_bstr()),
+ format!(
+ "the tree carries no `{field}` field to bind {}",
+ name.as_bstr()
+ ),
)),
}
}
crates/kernel/ents-receive/src/lib.rs
@@ -100,8 +100,7 @@
pub use outcome::{Mode, Outcome, TxResult};
pub use proposal::{Proposal, RefTransition, TransportAuth};
pub use propose::{
- Identity, propose_delete, propose_entity, propose_entity_with_pin, propose_genesis,
- propose_pin,
+ Identity, propose_delete, propose_entity, propose_entity_with_pin, propose_genesis, propose_pin,
};
pub use receive::receive;
pub use reconcile::reconcile;
crates/kernel/ents-sync/src/resolve.rs
@@ -24,7 +24,6 @@
use gix_hash::ObjectId;
use gix_object::{Commit, Find, Kind, Write, WriteTo as _};
-
use crate::error::{Error, Result};
use crate::merge::{Merge, three_way};
use crate::objects::{commit_tree, parents};
crates/kernel/ents-testutil/src/seed.rs
@@ -177,8 +177,7 @@
/// is not hex (query scan fixtures do not gate on the target).
fn target_for(short_oid: &str) -> ObjectId {
let padded = format!("{short_oid:0<40}");
- ObjectId::from_hex(padded.as_bytes())
- .unwrap_or_else(|_| ObjectId::null(gix_hash::Kind::Sha1))
+ ObjectId::from_hex(padded.as_bytes()).unwrap_or_else(|_| ObjectId::null(gix_hash::Kind::Sha1))
}
/// Append `count` empty-tree commits on top of `refname`'s current tip