mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-16 00:00:37 +08:00
protocol: Decode radicle_oid::Oid without git2
`impl Decode for Oid` uses `git2` via `radicle::git::raw`. This is unnecessarily complex.
This commit is contained in:
committed by
Lorenz Leutgeb
parent
3d1b37fcbb
commit
8dba3ca9de
@@ -21,7 +21,6 @@ use cypheraddr::tor;
|
||||
use radicle::crypto::{PublicKey, Signature};
|
||||
use radicle::git;
|
||||
use radicle::git::fmt;
|
||||
use radicle::git::raw;
|
||||
use radicle::identity::RepoId;
|
||||
use radicle::node;
|
||||
use radicle::node::Alias;
|
||||
@@ -390,11 +389,7 @@ impl Decode for git::Oid {
|
||||
return Err(Invalid::Oid { actual: len }.into());
|
||||
}
|
||||
|
||||
let buf: [u8; git::Oid::SHA1_LEN] = Decode::decode(buf)?;
|
||||
let oid = raw::Oid::from_bytes(&buf).expect("the buffer is exactly the right size");
|
||||
let oid = git::Oid::from(oid);
|
||||
|
||||
Ok(oid)
|
||||
Ok(git::Oid::Sha1(Decode::decode(buf)?))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user