From 01e2305a41395d98ba869d8c8445d176edc289a9 Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Fri, 16 Dec 2022 11:00:16 +0000 Subject: [PATCH] surf: missed expect from refactoring diff A placeholder `.expect("TODO")` was left in the diff code while refactoring. Change the `expect` to `?` and use the correct `type Error`. Signed-off-by: Fintan Halpenny X-Clacks-Overhead: GNU Terry Pratchett --- radicle-surf/src/diff/git.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicle-surf/src/diff/git.rs b/radicle-surf/src/diff/git.rs index 180498e..eabe58f 100644 --- a/radicle-surf/src/diff/git.rs +++ b/radicle-surf/src/diff/git.rs @@ -129,7 +129,7 @@ impl TryFrom> for Hunks { } impl TryFrom> for Hunks { - type Error = git2::Error; + type Error = error::Deletion; fn try_from(patch: git2::Patch) -> Result { let mut hunks = Vec::with_capacity(patch.num_hunks()); @@ -140,7 +140,7 @@ impl TryFrom> for Hunks { 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 }) }