mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-28 21:50:26 +08:00
This keeps the top level of the repo cleaner, e.g. <https://github.com/radicle-dev/heartwood> scrolls less and <https://app.radicle.xyz/nodes/rosa.radicle.xyz/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5/> might show more files at the top level. This way we also don't have to explicitly name all crates in `Cargo.toml`.
24 lines
609 B
Rust
24 lines
609 B
Rust
pub(crate) mod mem;
|
|
pub(crate) mod packfile;
|
|
pub(crate) mod repository;
|
|
|
|
pub mod refs;
|
|
|
|
pub(crate) mod oid {
|
|
//! Helper functions for converting to/from [`radicle::git::Oid`] and
|
|
//! [`ObjectId`].
|
|
|
|
use gix_hash::ObjectId;
|
|
use radicle::git::Oid;
|
|
|
|
/// Convert from an [`ObjectId`] to an [`Oid`].
|
|
pub fn to_oid(oid: ObjectId) -> Oid {
|
|
Oid::try_from(oid.as_bytes()).expect("invalid gix Oid")
|
|
}
|
|
|
|
/// Convert from an [`Oid`] to an [`ObjectId`].
|
|
pub fn to_object_id(oid: Oid) -> ObjectId {
|
|
ObjectId::from(gix_hash::oid::from_bytes_unchecked(oid.as_ref()))
|
|
}
|
|
}
|