Skip to content

Commit 58f3ef4

Browse files
committed
Shrink the error types a bit
1 parent 92696d2 commit 58f3ef4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

patchable/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ use std::{
88
use git2::{Commit, Object, Oid, Reference, Repository};
99

1010
#[derive(Debug)]
11-
pub struct CommitId(Oid);
11+
pub struct CommitId(Box<Oid>);
1212
impl Display for CommitId {
1313
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1414
write!(f, "{}", self.0)
1515
}
1616
}
1717
impl From<Oid> for CommitId {
1818
fn from(value: Oid) -> Self {
19-
Self(value)
19+
Self(Box::new(value))
2020
}
2121
}
2222
impl From<&Commit<'_>> for CommitId {

patchable/src/patch_mail.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ pub enum Error {
6262
NoSubject,
6363
#[snafu(display("failed to parse \"Date\" header (should be RFC2822)"))]
6464
InvalidMailDate {
65-
source: time::error::Parse,
65+
#[snafu(source(from(time::error::Parse, Box::new)))]
66+
source: Box<time::error::Parse>,
6667
date: String,
6768
},
6869
#[snafu(display("failed to build commit signature from headers"))]

0 commit comments

Comments
 (0)