Update scalafmt-core to 2.6.0

This commit is contained in:
Eike Kettner
2020-06-17 19:53:56 +02:00
parent 7a3d2e4dc6
commit 897d91475e
6 changed files with 10 additions and 15 deletions

View File

@ -221,13 +221,12 @@ object LenientUri {
if (!s.contains("%")) s
else
s.foldLeft(("", ByteVector.empty)) {
case ((acc, res), c) =>
if (acc.length == 2) ("", res ++ ByteVector.fromValidHex(acc.drop(1) + c))
else if (acc.startsWith("%")) (acc :+ c, res)
else if (c == '%') ("%", res)
else (acc, res :+ c.toByte)
}
._2
case ((acc, res), c) =>
if (acc.length == 2) ("", res ++ ByteVector.fromValidHex(acc.drop(1) + c))
else if (acc.startsWith("%")) (acc :+ c, res)
else if (c == '%') ("%", res)
else (acc, res :+ c.toByte)
}._2
.decodeUtf8
.fold(throw _, identity)