Skip to content

Commit

Permalink
Merge pull request #6 from PurpleBooth/iter_intersperse_support
Browse files Browse the repository at this point in the history
Support stablised iter_intersperse
  • Loading branch information
CAD97 authored Oct 2, 2021
2 parents b69a54c + 685734c commit edeee23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ fn format_add_rem(f: &mut fmt::Formatter, added: &str, removed: &str) -> fmt::Re
for diff in &diffs {
match diff {
Difference::Same(text) => {
for blob in text.split('\n').intersperse(NL_LEFT) {
for blob in Itertools::intersperse(text.split('\n'), NL_LEFT) {
write!(f, "{}", red(blob))?;
}
}
Difference::Rem(text) => {
for blob in text.split('\n').intersperse(NL_LEFT) {
for blob in Itertools::intersperse(text.split('\n'), NL_LEFT) {
write!(f, "{}", on_red(blob))?;
}
}
Expand All @@ -118,12 +118,12 @@ fn format_add_rem(f: &mut fmt::Formatter, added: &str, removed: &str) -> fmt::Re
for diff in &diffs {
match diff {
Difference::Same(text) => {
for blob in text.split('\n').intersperse(NL_RIGHT) {
for blob in Itertools::intersperse(text.split('\n'), NL_RIGHT) {
write!(f, "{}", green(blob))?;
}
}
Difference::Add(text) => {
for blob in text.split('\n').intersperse(NL_RIGHT) {
for blob in Itertools::intersperse(text.split('\n'), NL_RIGHT) {
write!(f, "{}", on_green(blob))?;
}
}
Expand Down

0 comments on commit edeee23

Please sign in to comment.