File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
kotlinx-coroutines-rx-example/src/main/kotlin Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ private fun startLongAsyncOperation(v: Int) =
2121 }
2222
2323fun main (args : Array <String >) {
24- val future = async< String > {
24+ val future = async {
2525 (1 .. 5 ).map {
2626 await(startLongAsyncOperation(it))
2727 }.joinToString(" \n " )
@@ -39,7 +39,7 @@ it will not work with earlier versions.
3939import kotlinx.coroutines.generate
4040
4141fun main (args : Array <String >) {
42- val sequence = generate< Int > {
42+ val sequence = generate {
4343 for (i in 1 .. 5 ) {
4444 yield (i)
4545 }
@@ -75,7 +75,7 @@ fun main(args: Array<String>) {
7575
7676 val github = retrofit.create(GitHub ::class .java)
7777
78- asyncRx< Unit > {
78+ asyncRx {
7979 for (org in listOf (" Kotlin" , " ReactiveX" )) {
8080 // `awaitSingle()` call here is a suspension point,
8181 // i.e. coroutine's code stops on it until request is not completed
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ fun main(args: Array<String>) {
4242
4343 val otherRepos =
4444 github.listRepos(name).awaitSingle()
45- .map { it. name } .joinToString(" , " )
45+ .map( Repo :: name) .joinToString(" , " )
4646
4747 println (otherRepos)
4848 }
You can’t perform that action at this time.
0 commit comments