Radish alpha
r
rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt
Git libraries for Radicle
Radicle
Git
surf: missed expect from refactoring diff
Fintan Halpenny committed 3 years ago
commit 01e2305a41395d98ba869d8c8445d176edc289a9
parent 8d451e3
1 file changed +2 -2
modified radicle-surf/src/diff/git.rs
@@ -129,7 +129,7 @@ impl TryFrom<git2::Patch<'_>> for Hunks<Addition> {
}

impl TryFrom<git2::Patch<'_>> for Hunks<Deletion> {
-
    type Error = git2::Error;
+
    type Error = error::Deletion;

    fn try_from(patch: git2::Patch) -> Result<Self, Self::Error> {
        let mut hunks = Vec::with_capacity(patch.num_hunks());
@@ -140,7 +140,7 @@ impl TryFrom<git2::Patch<'_>> for Hunks<Deletion> {

            for l in 0..hunk_lines {
                let line = patch.line_in_hunk(h, l)?;
-
                lines.push(Deletion::try_from(line).expect("TODO"));
+
                lines.push(Deletion::try_from(line)?);
            }
            hunks.push(Hunk { header, lines })
        }