diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2017-03-28 11:14:47 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2017-03-28 11:14:47 +1300 |
| commit | 5fb1140688ae9e8a0cfc9d90a00f7dad4935e029 (patch) | |
| tree | 861133499fd946915cfd2c49dbaa3e4976ea46a9 /src/rustfmt_diff.rs | |
| parent | a079b87e7c7a937bd689e51af5c2c2b4ba690ca7 (diff) | |
fallout - source reformatting
Diffstat (limited to 'src/rustfmt_diff.rs')
| -rw-r--r-- | src/rustfmt_diff.rs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/rustfmt_diff.rs b/src/rustfmt_diff.rs index 23cb3f21bf2..4d05f544290 100644 --- a/src/rustfmt_diff.rs +++ b/src/rustfmt_diff.rs @@ -42,10 +42,14 @@ pub fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec<Misma } while let Some(line) = context_queue.pop_front() { - mismatch.lines.push(DiffLine::Context(line.to_owned())); + mismatch + .lines + .push(DiffLine::Context(line.to_owned())); } - mismatch.lines.push(DiffLine::Resulting(str.to_owned())); + mismatch + .lines + .push(DiffLine::Resulting(str.to_owned())); lines_since_mismatch = 0; } diff::Result::Right(str) => { @@ -55,10 +59,14 @@ pub fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec<Misma } while let Some(line) = context_queue.pop_front() { - mismatch.lines.push(DiffLine::Context(line.to_owned())); + mismatch + .lines + .push(DiffLine::Context(line.to_owned())); } - mismatch.lines.push(DiffLine::Expected(str.to_owned())); + mismatch + .lines + .push(DiffLine::Expected(str.to_owned())); line_number += 1; lines_since_mismatch = 0; } @@ -68,7 +76,9 @@ pub fn make_diff(expected: &str, actual: &str, context_size: usize) -> Vec<Misma } if lines_since_mismatch < context_size { - mismatch.lines.push(DiffLine::Context(str.to_owned())); + mismatch + .lines + .push(DiffLine::Context(str.to_owned())); } else { context_queue.push_back(str); } |
