Skip to content

Commit cbac96d

Browse files
committed
scala 2.12 compilation fix
1 parent 6482c47 commit cbac96d

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### 0.2.0
44

5-
Adding apply converters for converting `FunctionN[..., Out]` into `Function1[TupleN[...], Out]`
5+
Better diffing in complicated scenarios.
66

77
### 0.1.0
88

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
A library for diff-ing strings.
66

77
```scala
8-
"app.tulz" %%% "stringdiff" % "0.1.1"
8+
"app.tulz" %%% "stringdiff" % "0.2.0"
99
```
1010

1111
### Usage
@@ -39,9 +39,11 @@ StringDiff.withFormat("prefix common1 common2 inside1 common3 common4", "common1
3939
#### Raw AST
4040

4141
```scala
42-
import app.tulz.diff.StringDiff
42+
import app.tulz.diff._
4343

4444
StringDiff.raw("prefix common1 common2 inside1 common3 common4", "common1 common2 inside2 common3 suffix") // List[DiffBlock]
45+
// OR
46+
StringDiff.withFormat("prefix common1 common2 inside1 common3 common4", "common1 common2 inside2 common3 suffix")(RawDiffFormat) // List[DiffBlock]
4547
```
4648

4749
```scala
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package app.tulz.diff
2+
3+
object RawDiffFormat extends DiffFormat[List[DiffBlock]] {
4+
5+
def apply(diff: List[DiffBlock]): List[DiffBlock] = diff
6+
7+
}

stringdiff/src/main/scala/app/tulz/diff/StringDiff.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ object StringDiff {
1717
def raw(
1818
actual: String,
1919
expected: String
20-
): List[DiffBlock] = withFormat(actual, expected)(identity)
20+
): List[DiffBlock] = withFormat(actual, expected)(RawDiffFormat)
2121

2222
def withFormat[T](
2323
actual: String,

version.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version in ThisBuild := "0.2.0-SNAPSHOT"
1+
version in ThisBuild := "0.2.0"

0 commit comments

Comments
 (0)