diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2fe780f9..c53cd897 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,7 +15,7 @@ clikt = "com.github.ajalt.clikt:clikt:5.1.0" junit = "junit:junit:4.13.2" assertk = "com.willowtreeapps.assertk:assertk:0.28.1" okio = "com.squareup.okio:okio:3.17.0" -bytesize = "me.saket.bytesize:bytesize:2.2.0" +bytesize = "me.saket.bytesize:bytesize:2.2.1" asm = "org.ow2.asm:asm:9.9.1" diffUtils = "io.github.java-diff-utils:java-diff-utils:4.16" picnic = "com.jakewharton.picnic:picnic:0.7.0" diff --git a/reports/src/main/kotlin/com/jakewharton/diffuse/diff/ArchiveFilesDiff.kt b/reports/src/main/kotlin/com/jakewharton/diffuse/diff/ArchiveFilesDiff.kt index a574787a..93ddcdf0 100644 --- a/reports/src/main/kotlin/com/jakewharton/diffuse/diff/ArchiveFilesDiff.kt +++ b/reports/src/main/kotlin/com/jakewharton/diffuse/diff/ArchiveFilesDiff.kt @@ -12,6 +12,7 @@ import com.jakewharton.picnic.TextAlignment.MiddleCenter import com.jakewharton.picnic.TextAlignment.MiddleRight import com.jakewharton.picnic.renderText import me.saket.bytesize.ByteSize +import me.saket.bytesize.absoluteValue import me.saket.bytesize.binaryBytes internal class ArchiveFilesDiff( diff --git a/reports/src/main/kotlin/com/jakewharton/diffuse/diff/SizeExtensions.kt b/reports/src/main/kotlin/com/jakewharton/diffuse/diff/SizeExtensions.kt deleted file mode 100644 index 274fe171..00000000 --- a/reports/src/main/kotlin/com/jakewharton/diffuse/diff/SizeExtensions.kt +++ /dev/null @@ -1,16 +0,0 @@ -package com.jakewharton.diffuse.diff - -import kotlin.math.absoluteValue -import me.saket.bytesize.BinaryByteSize -import me.saket.bytesize.ByteSize -import me.saket.bytesize.DecimalBitSize -import me.saket.bytesize.DecimalByteSize - -/** TODO: https://github.com/saket/byte-size/issues/22 */ -internal val ByteSize.absoluteValue: ByteSize - get() = - when (this) { - is DecimalBitSize -> DecimalBitSize(inWholeBits.absoluteValue) - is BinaryByteSize -> BinaryByteSize(inWholeBytes.absoluteValue) - is DecimalByteSize -> DecimalByteSize(inWholeBytes.absoluteValue) - }