Skip to content

Commit e8c9126

Browse files
authored
Merge pull request #1141 from ehuss/patch-lifetime
Fix lifetimes of outputs for Patch
2 parents d1ae3b6 + 4c92a5c commit e8c9126

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/patch.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<'buffers> Patch<'buffers> {
125125
}
126126

127127
/// Get the DiffDelta associated with the Patch.
128-
pub fn delta(&self) -> DiffDelta<'buffers> {
128+
pub fn delta<'a>(&'a self) -> DiffDelta<'a> {
129129
unsafe { Binding::from_raw(raw::git_patch_get_delta(self.raw) as *mut _) }
130130
}
131131

@@ -151,7 +151,7 @@ impl<'buffers> Patch<'buffers> {
151151
}
152152

153153
/// Get a DiffHunk and its total line count from the Patch.
154-
pub fn hunk(&self, hunk_idx: usize) -> Result<(DiffHunk<'buffers>, usize), Error> {
154+
pub fn hunk<'a>(&'a self, hunk_idx: usize) -> Result<(DiffHunk<'a>, usize), Error> {
155155
let mut ret = ptr::null();
156156
let mut lines = 0;
157157
unsafe {
@@ -168,11 +168,11 @@ impl<'buffers> Patch<'buffers> {
168168
}
169169

170170
/// Get a DiffLine from a hunk of the Patch.
171-
pub fn line_in_hunk(
172-
&self,
171+
pub fn line_in_hunk<'a>(
172+
&'a self,
173173
hunk_idx: usize,
174174
line_of_hunk: usize,
175-
) -> Result<DiffLine<'buffers>, Error> {
175+
) -> Result<DiffLine<'a>, Error> {
176176
let mut ret = ptr::null();
177177
unsafe {
178178
try_call!(raw::git_patch_get_line_in_hunk(

0 commit comments

Comments
 (0)