Skip to content

Commit 2d03a83

Browse files
authored
docs(implicit-conversions): use new given syntax
given syntax was changed to use `:` over `with` since scala 3.6: https://docs.scala-lang.org/scala3/reference/contextual/givens.html
1 parent c5a16ee commit 2d03a83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

_overviews/scala3-book/ca-implicit-conversions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ be defined by an implicit method (read more in the Scala 2 tab).
8888
For example, this code defines an implicit conversion from `Int` to `Long`:
8989

9090
```scala
91-
given int2long: Conversion[Int, Long] with
91+
given int2long: Conversion[Int, Long]:
9292
def apply(x: Int): Long = x.toLong
9393
```
9494

9595
Like other given definitions, implicit conversions can be anonymous:
9696

9797
~~~ scala
98-
given Conversion[Int, Long] with
98+
given Conversion[Int, Long]:
9999
def apply(x: Int): Long = x.toLong
100100
~~~
101101

0 commit comments

Comments
 (0)