Skip to content

Commit 083f2b6

Browse files
committed
Use a more generic term for score
1 parent 5ab00f6 commit 083f2b6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

gix-diff/src/blob/git_diff.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ pub enum ChangeKind {
3939
}
4040

4141
#[derive(PartialEq)]
42-
struct SplitScore {
42+
struct Score {
4343
effective_indent: i16,
4444
penalty: i16,
4545
}
4646

47-
impl PartialOrd for SplitScore {
47+
impl PartialOrd for Score {
4848
// A score is considered "Greater" if it is equal or less than 0
4949
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
5050
let indent_penalty = match self.effective_indent.cmp(&other.effective_indent) {
@@ -102,7 +102,7 @@ fn get_indent(s: String) -> Option<u8> {
102102
None
103103
}
104104

105-
fn measure_and_score_change<T: Display>(lines: &[Token], split: usize, interner: &Interner<T>, score: &mut SplitScore) {
105+
fn measure_and_score_change<T: Display>(lines: &[Token], split: usize, interner: &Interner<T>, score: &mut Score) {
106106
// Gather information about the surroundings of the change
107107
let end_of_file = split >= lines.len();
108108
let mut indent: Option<u8> = if split >= lines.len() {
@@ -268,7 +268,7 @@ where
268268
}
269269

270270
let mut best_shift: Option<usize> = None;
271-
let mut best_score = SplitScore {
271+
let mut best_score = Score {
272272
effective_indent: 0,
273273
penalty: 0,
274274
};
@@ -282,7 +282,7 @@ where
282282
}
283283

284284
while shift <= change.after.end {
285-
let mut score = SplitScore {
285+
let mut score = Score {
286286
effective_indent: 0,
287287
penalty: 0,
288288
};

0 commit comments

Comments
 (0)