mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Fix compile warnings after scala update
This commit is contained in:
@ -78,7 +78,11 @@ case class LenientUri(
|
||||
.covary[F]
|
||||
.rethrow
|
||||
.flatMap(url =>
|
||||
fs2.io.readInputStream(Sync[F].delay(url.openStream()), chunkSize, true)
|
||||
fs2.io.readInputStream(
|
||||
Sync[F].delay(url.openStream()),
|
||||
chunkSize,
|
||||
closeAfterUse = true
|
||||
)
|
||||
)
|
||||
|
||||
def readText[F[_]: Sync](chunkSize: Int): F[String] =
|
||||
@ -121,7 +125,7 @@ object LenientUri {
|
||||
val isRoot = true
|
||||
val isEmpty = false
|
||||
def /(seg: String): Path =
|
||||
NonEmptyPath(NonEmptyList.of(seg), false)
|
||||
NonEmptyPath(NonEmptyList.of(seg), trailingSlash = false)
|
||||
def asString = "/"
|
||||
}
|
||||
case object EmptyPath extends Path {
|
||||
@ -129,7 +133,7 @@ object LenientUri {
|
||||
val isRoot = false
|
||||
val isEmpty = true
|
||||
def /(seg: String): Path =
|
||||
NonEmptyPath(NonEmptyList.of(seg), false)
|
||||
NonEmptyPath(NonEmptyList.of(seg), trailingSlash = false)
|
||||
def asString = ""
|
||||
}
|
||||
case class NonEmptyPath(segs: NonEmptyList[String], trailingSlash: Boolean)
|
||||
|
@ -194,7 +194,7 @@ object MimeType {
|
||||
val csValueStart = in.substring(n + "charset=".length).trim
|
||||
val csName = csValueStart.indexOf(';') match {
|
||||
case -1 => unquote(csValueStart).trim
|
||||
case n => unquote(csValueStart.substring(0, n)).trim
|
||||
case n2 => unquote(csValueStart.substring(0, n2)).trim
|
||||
}
|
||||
if (Charset.isSupported(csName)) Right((Some(Charset.forName(csName)), ""))
|
||||
else Right((None, ""))
|
||||
|
@ -62,7 +62,7 @@ object UrlMatcher {
|
||||
// strip path to only match prefixes
|
||||
val mPath: LenientUri.Path =
|
||||
NonEmptyList.fromList(url.path.segments.take(pathSegmentCount)) match {
|
||||
case Some(nel) => LenientUri.NonEmptyPath(nel, false)
|
||||
case Some(nel) => LenientUri.NonEmptyPath(nel, trailingSlash = false)
|
||||
case None => LenientUri.RootPath
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user