Skip to content

Commit

Permalink
some inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Mar 16, 2024
1 parent 16de30d commit 228afda
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions src/main/scala/Bus.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ object Bus:
type ChanSelect = Bus.channel.type => Chan

object channel:
def sri(s: Sri) = s"sri/$s"
def flag(f: Flag) = s"flag/$f"
val mlat = "mlat"
val all = "all"
val lobby = "lobby"
val tv = "tv"
val tvChannels = "tv-channels"
def userTv(u: UserTv) = s"userTv/$u"
def room(id: RoomId) = s"room/$id"
def tourStanding(id: Tour.Id) = s"tour-standing/$id"
def externalChat(id: RoomId) = s"external-chat/$id"
inline def sri(inline s: Sri) = s"sri/$s"
inline def flag(inline f: Flag) = s"flag/$f"
val mlat = "mlat"
val all = "all"
val lobby = "lobby"
val tv = "tv"
val tvChannels = "tv-channels"
inline def userTv(inline u: UserTv) = s"userTv/$u"
inline def room(inline id: RoomId) = s"room/$id"
inline def tourStanding(inline id: Tour.Id) = s"tour-standing/$id"
inline def externalChat(inline id: RoomId) = s"external-chat/$id"

def msg(event: ClientMsg, chan: ChanSelect) =
Msg(event, chan(channel))
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/util/JsExtension.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extension (js: JsObject)
def obj(key: String): Option[JsObject] =
(js \ key).asOpt[JsObject]

def get[A: Reads](key: String): Option[A] =
inline def get[A: Reads](inline key: String): Option[A] =
(js \ key).asOpt[A]

def arr(key: String): Option[JsArray] =
Expand Down

0 comments on commit 228afda

Please sign in to comment.