Skip to content

Commit

Permalink
Update indentation style
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Nov 11, 2024
1 parent 5168ec7 commit 3dbfbdb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 22 deletions.
20 changes: 10 additions & 10 deletions src/core/turbulence-core.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ extension [ValueType](value: ValueType)
aggregable.aggregate(value.stream[Text])

def writeTo[TargetType](target: TargetType)[ElementType]
(using readable: ValueType is Readable by ElementType, writable: TargetType is Writable by ElementType)
(using readable: ValueType is Readable by ElementType, writable: TargetType is Writable by ElementType)
: Unit =

writable.write(target, readable.stream(value))
Expand Down Expand Up @@ -84,7 +84,7 @@ extension [ElementType](stream: LazyList[ElementType])
stream.flow(LazyList())(head #:: recur(head, tail))

inline def flow[ResultType](inline termination: => ResultType)
(inline proceed: (head: ElementType, tail: LazyList[ElementType]) ?=> ResultType)
(inline proceed: (head: ElementType, tail: LazyList[ElementType]) ?=> ResultType)
: ResultType =
stream match
case head #:: tail => proceed(using head, tail)
Expand All @@ -93,7 +93,7 @@ extension [ElementType](stream: LazyList[ElementType])
def strict: LazyList[ElementType] = stream.length yet stream

def rate[DurationType: GenericDuration: SpecificDuration](duration: DurationType)
(using Monitor, Tactic[ConcurrencyError])
(using Monitor, Tactic[ConcurrencyError])
: LazyList[ElementType] =

def recur(stream: LazyList[ElementType], last: Long): LazyList[ElementType] =
Expand All @@ -109,18 +109,18 @@ extension [ElementType](stream: LazyList[ElementType])

def regulate(tap: Tap)(using Monitor): LazyList[ElementType] =
def defer
(active: Boolean,
stream: LazyList[Some[ElementType] | Tap.Regulation],
buffer: List[ElementType])
(active: Boolean,
stream: LazyList[Some[ElementType] | Tap.Regulation],
buffer: List[ElementType])
: LazyList[ElementType] =

recur(active, stream, buffer)

@tailrec
def recur
(active: Boolean,
stream: LazyList[Some[ElementType] | Tap.Regulation],
buffer: List[ElementType])
(active: Boolean,
stream: LazyList[Some[ElementType] | Tap.Regulation],
buffer: List[ElementType])
: LazyList[ElementType] =

if active && buffer.nonEmpty then buffer.head #:: defer(true, stream, buffer.tail)
Expand All @@ -139,7 +139,7 @@ extension [ElementType](stream: LazyList[ElementType])
LazyList.defer(recur(true, stream.map(Some(_)).multiplexWith(tap.stream), Nil))

def cluster[DurationType: GenericDuration](duration: DurationType, maxSize: Optional[Int] = Unset)
(using Monitor)
(using Monitor)
: LazyList[List[ElementType]] =

val Limit = maxSize.or(Int.MaxValue)
Expand Down
2 changes: 1 addition & 1 deletion src/core/turbulence.Aggregable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ object Aggregable:
buffer.toString.tt

given [ElementType, ElementType2]
(using aggregable: ElementType2 is Aggregable by ElementType)
(using aggregable: ElementType2 is Aggregable by ElementType)
=> LazyList[ElementType2] is Aggregable by ElementType as lazyList =
element => LazyList(aggregable.aggregate(element))

Expand Down
14 changes: 7 additions & 7 deletions src/core/turbulence.LineSeparation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ object LineSeparation:
given (using Quickstart) => LineSeparation as default = lineSeparation.adaptiveLinefeed

inline def readByte
(inline read: => Byte, next: => Unit, inline mkNewline: => Unit, inline put: Byte => Unit)
(lineSeparators: LineSeparation)
(inline read: => Byte, next: => Unit, inline mkNewline: => Unit, inline put: Byte => Unit)
(lineSeparators: LineSeparation)
: Unit =

val action: Action = read match
Expand Down Expand Up @@ -72,11 +72,11 @@ object LineSeparation:
case Nl, NlCr, NlLf, LfNl, CrNl, NlNl, Cr, Lf, Skip

case class LineSeparation
(newline: LineSeparation.NewlineSeq,
cr: LineSeparation.Action,
lf: LineSeparation.Action,
crlf: LineSeparation.Action,
lfcr: LineSeparation.Action):
(newline: LineSeparation.NewlineSeq,
cr: LineSeparation.Action,
lf: LineSeparation.Action,
crlf: LineSeparation.Action,
lfcr: LineSeparation.Action):

def newlineBytes = newline match
case LineSeparation.NewlineSeq.Cr => Bytes(13)
Expand Down
8 changes: 4 additions & 4 deletions src/core/turbulence.Stdio.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import vacuous.*

object Stdio:
def apply
(out: ji.PrintStream | Null,
err: ji.PrintStream | Null,
in: ji.InputStream | Null,
termcap: Termcap)
(out: ji.PrintStream | Null,
err: ji.PrintStream | Null,
in: ji.InputStream | Null,
termcap: Termcap)
: Stdio =

val safeOut: ji.PrintStream = Optional(out).or(MutePrintStream)
Expand Down

0 comments on commit 3dbfbdb

Please sign in to comment.