Skip to content

Commit 8de1970

Browse files
committed
diff: remove getter/setter
1 parent 4e568a5 commit 8de1970

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

text/diff_util/file_diff.rs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ pub struct FileDiff<'a> {
2828
}
2929

3030
impl<'a> FileDiff<'a> {
31-
pub fn are_different(&self) -> bool {
32-
self.are_different
33-
}
34-
35-
pub fn set_different(&mut self, are_different: bool) {
36-
self.are_different = are_different;
37-
}
38-
3931
fn new(
4032
file1: &'a mut FileData<'a>,
4133
file2: &'a mut FileData<'a>,
@@ -105,10 +97,10 @@ impl<'a> FileDiff<'a> {
10597
.create_hunks_from_lcs(&lcs_indices, num_lines1, num_lines2);
10698

10799
if diff.hunks.hunk_count() > 0 {
108-
diff.set_different(true);
100+
diff.are_different = true;
109101
}
110102

111-
if diff.are_different() {
103+
if diff.are_different {
112104
if let Some(show_if_different) = show_if_different {
113105
println!("{}", show_if_different);
114106
}
@@ -216,7 +208,7 @@ impl<'a> FileDiff<'a> {
216208
}
217209
}
218210

219-
if self.are_different() {
211+
if self.are_different {
220212
Ok(DiffExitStatus::Different)
221213
} else {
222214
Ok(DiffExitStatus::NotDifferent)

0 commit comments

Comments
 (0)