Skip to content

Commit abe3eaf

Browse files
bbqsrcalexcrichton
authored andcommitted
Make some patch functions only require &self (#339)
1 parent d50bdab commit abe3eaf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/patch.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl Patch {
139139
}
140140

141141
/// Get a DiffHunk and its total line count from the Patch.
142-
pub fn hunk(&mut self, hunk_idx: usize) -> Result<(DiffHunk, usize), Error> {
142+
pub fn hunk(&self, hunk_idx: usize) -> Result<(DiffHunk, usize), Error> {
143143
let mut ret = ptr::null();
144144
let mut lines = 0;
145145
unsafe {
@@ -156,7 +156,7 @@ impl Patch {
156156
}
157157

158158
/// Get a DiffLine from a hunk of the Patch.
159-
pub fn line_in_hunk(&mut self,
159+
pub fn line_in_hunk(&self,
160160
hunk_idx: usize,
161161
line_of_hunk: usize) -> Result<DiffLine, Error> {
162162
let mut ret = ptr::null();

0 commit comments

Comments
 (0)