Skip to content

Commit 4ea35ff

Browse files
committed
chore: Add short alias for ScalafmtModule
1 parent 382153a commit 4ea35ff

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed
File renamed without changes.

build.mill

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import com.github.lolgab.mill.mima._
1313
val dottyVersion = sys.props.get("dottyVersion")
1414
val scalaVersions = List("2.12.20", "2.13.15", "3.6.2") ++ dottyVersion
1515

16+
def format = mill.scalalib.scalafmt.ScalafmtModule
17+
1618
trait RequestsJvmModule extends RequestsModule with Mima {
1719
def mimaPreviousArtifacts = Agg(
1820
(

requests/src/requests/Model.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,15 @@ object RequestBlob {
8383
s.contentLength.map("Content-Length" -> _.toString)
8484
def write(out: java.io.OutputStream) = s.writeBytesTo(out)
8585
}
86+
8687
implicit class FileRequestBlob(x: java.io.File) extends RequestBlob {
8788
override def headers = super.headers ++ Seq(
8889
"Content-Type" -> "application/octet-stream",
8990
"Content-Length" -> x.length().toString,
9091
)
9192
def write(out: java.io.OutputStream) = Util.transferTo(new FileInputStream(x), out)
9293
}
94+
9395
implicit class NioFileRequestBlob(x: java.nio.file.Path) extends RequestBlob {
9496
override def headers = super.headers ++ Seq(
9597
"Content-Type" -> "application/octet-stream",
@@ -101,9 +103,8 @@ object RequestBlob {
101103

102104
implicit class FormEncodedRequestBlob(val x: Iterable[(String, String)]) extends RequestBlob {
103105
val serialized = Util.urlEncode(x).getBytes
104-
override def headers = super.headers ++ Seq(
105-
"Content-Type" -> "application/x-www-form-urlencoded",
106-
)
106+
override def headers =
107+
super.headers ++ Seq("Content-Type" -> "application/x-www-form-urlencoded")
107108
def write(out: java.io.OutputStream) = {
108109
out.write(serialized)
109110
}
@@ -262,7 +263,9 @@ object RequestAuth {
262263
object Empty extends RequestAuth {
263264
def header = None
264265
}
266+
265267
implicit def implicitBasic(x: (String, String)): Basic = new Basic(x._1, x._2)
268+
266269
class Basic(username: String, password: String) extends RequestAuth {
267270
def header = Some(
268271
"Basic " + java.util.Base64.getEncoder.encodeToString((username + ":" + password).getBytes()),

0 commit comments

Comments
 (0)