mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-14 23:40:33 +08:00
Add a CommitObject::TryFrom<git2::Buf> instance
Signed-off-by: Alexis Sellier <alexis@radicle.xyz>
This commit is contained in:
@@ -323,6 +323,14 @@ pub mod commit {
|
||||
InvalidFormat,
|
||||
}
|
||||
|
||||
impl TryFrom<git2::Buf> for CommitObject {
|
||||
type Error = ParseError;
|
||||
|
||||
fn try_from(value: git2::Buf) -> Result<Self, Self::Error> {
|
||||
value.as_str().ok_or(ParseError::InvalidFormat)?.parse()
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for CommitObject {
|
||||
type Err = ParseError;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user