From 37a2c34607d8a0b3e0cbeae94a597958dbfda6d2 Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Sat, 5 Oct 2024 10:29:17 +0900 Subject: [PATCH] prepare Scala 3, sbt 2 build --- gpg-library/src/main/scala/com/jsuereth/pgp/PublicKey.scala | 2 +- .../scala/com/jsuereth/pgp/PublicKeyRingCollection.scala | 2 +- .../src/main/scala/com/jsuereth/pgp/SecretKeyRing.scala | 2 +- .../scala/com/jsuereth/pgp/SecretKeyRingCollection.scala | 2 +- .../src/main/scala/com/jsuereth/pgp/hkp/client.scala | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/gpg-library/src/main/scala/com/jsuereth/pgp/PublicKey.scala b/gpg-library/src/main/scala/com/jsuereth/pgp/PublicKey.scala index 67ab3b0..85c528d 100644 --- a/gpg-library/src/main/scala/com/jsuereth/pgp/PublicKey.scala +++ b/gpg-library/src/main/scala/com/jsuereth/pgp/PublicKey.scala @@ -140,5 +140,5 @@ class PublicKey(val nested: PGPPublicKey) extends PublicKeyLike with StreamingSa } object PublicKey { def apply(nested: PGPPublicKey) = new PublicKey(nested) - implicit def unwrap(key: PublicKey) = key.nested + implicit def unwrap(key: PublicKey): PGPPublicKey = key.nested } diff --git a/gpg-library/src/main/scala/com/jsuereth/pgp/PublicKeyRingCollection.scala b/gpg-library/src/main/scala/com/jsuereth/pgp/PublicKeyRingCollection.scala index a2f3dc7..a0e5fdf 100644 --- a/gpg-library/src/main/scala/com/jsuereth/pgp/PublicKeyRingCollection.scala +++ b/gpg-library/src/main/scala/com/jsuereth/pgp/PublicKeyRingCollection.scala @@ -74,7 +74,7 @@ class PublicKeyRingCollection(val nested: PGPPublicKeyRingCollection) extends Pu override def toString = "PublicKeyRingCollecton(\n\t%s\n)" format (keyRings mkString ",\n\t") } object PublicKeyRingCollection extends StreamingLoadable[PublicKeyRingCollection] { - implicit def unwrap(ring: PublicKeyRingCollection) = ring.nested + implicit def unwrap(ring: PublicKeyRingCollection): PGPPublicKeyRingCollection = ring.nested def apply(nested: PGPPublicKeyRingCollection) = new PublicKeyRingCollection(nested) def load(input: InputStream) = apply(new PGPPublicKeyRingCollection(PGPUtil.getDecoderStream(input), new BcKeyFingerprintCalculator)) diff --git a/gpg-library/src/main/scala/com/jsuereth/pgp/SecretKeyRing.scala b/gpg-library/src/main/scala/com/jsuereth/pgp/SecretKeyRing.scala index d164873..23a0294 100644 --- a/gpg-library/src/main/scala/com/jsuereth/pgp/SecretKeyRing.scala +++ b/gpg-library/src/main/scala/com/jsuereth/pgp/SecretKeyRing.scala @@ -45,7 +45,7 @@ class SecretKeyRing(val nested: PGPSecretKeyRing) extends StreamingSaveable { } object SecretKeyRing extends StreamingLoadable[SecretKeyRing] { - implicit def unwrap(ring: SecretKeyRing) = ring.nested + implicit def unwrap(ring: SecretKeyRing): PGPSecretKeyRing = ring.nested def apply(ring: PGPSecretKeyRing) = new SecretKeyRing(ring) // TODO - Another way of generating SecretKeyRing from SecretKey objects. def load(input: InputStream) = diff --git a/gpg-library/src/main/scala/com/jsuereth/pgp/SecretKeyRingCollection.scala b/gpg-library/src/main/scala/com/jsuereth/pgp/SecretKeyRingCollection.scala index c36cd31..566ce06 100644 --- a/gpg-library/src/main/scala/com/jsuereth/pgp/SecretKeyRingCollection.scala +++ b/gpg-library/src/main/scala/com/jsuereth/pgp/SecretKeyRingCollection.scala @@ -54,7 +54,7 @@ class SecretKeyRingCollection(val nested: PGPSecretKeyRingCollection) extends St } object SecretKeyRingCollection extends StreamingLoadable[SecretKeyRingCollection] { - implicit def unwrap(ring: SecretKeyRingCollection) = ring.nested + implicit def unwrap(ring: SecretKeyRingCollection): PGPSecretKeyRingCollection = ring.nested def apply(nested: PGPSecretKeyRingCollection) = new SecretKeyRingCollection(nested) def load(input: InputStream) = apply(new PGPSecretKeyRingCollection(PGPUtil.getDecoderStream(input), new BcKeyFingerprintCalculator)) diff --git a/gpg-library/src/main/scala/com/jsuereth/pgp/hkp/client.scala b/gpg-library/src/main/scala/com/jsuereth/pgp/hkp/client.scala index d289097..ada9971 100644 --- a/gpg-library/src/main/scala/com/jsuereth/pgp/hkp/client.scala +++ b/gpg-library/src/main/scala/com/jsuereth/pgp/hkp/client.scala @@ -50,20 +50,20 @@ private[hkp] class GigahorseClient(serverUrl: String) extends Client { /** Pushes a key to the given public key server. */ def pushKey(key: PublicKey, logger: String => Unit): Unit = - http.run(initiateFormPost(AddKey(key)), Gigahorse.asString andThen { c: String => + http.run(initiateFormPost(AddKey(key)), Gigahorse.asString andThen { (c: String) => logger("received: " + c) }) /** Pushes a key to the given public key server. */ def pushKeyRing(key: PublicKeyRing, logger: String => Unit): Unit = - http.run(initiateFormPost(AddKey(key)), Gigahorse.asString andThen { c: String => + http.run(initiateFormPost(AddKey(key)), Gigahorse.asString andThen { (c: String) => logger("received: " + c) }) /** Searches for a term on the keyserver and returns all the results. */ def search(term: String): Future[Vector[LookupKeyResult]] = http - .run(initiateRequest(Find(term)), Gigahorse.asString andThen { s: String => + .run(initiateRequest(Find(term)), Gigahorse.asString andThen { (s: String) => Client.LookupParser.parse(s) }) .recover {