mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-11-21 10:30:43 +08:00
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 <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -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 })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user