mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Autoformat
This commit is contained in:
@ -222,12 +222,11 @@ object LenientUri {
|
||||
def percentDecode(s: String): String =
|
||||
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)
|
||||
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
|
||||
.decodeUtf8
|
||||
.fold(throw _, identity)
|
||||
|
@ -20,9 +20,8 @@ object SystemCommand {
|
||||
|
||||
def replace(repl: Map[String, String]): Config =
|
||||
mapArgs(s =>
|
||||
repl.foldLeft(s) {
|
||||
case (res, (k, v)) =>
|
||||
res.replace(k, v)
|
||||
repl.foldLeft(s) { case (res, (k, v)) =>
|
||||
res.replace(k, v)
|
||||
}
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user