From 3c274d72b7b5aa411c1cdc3edef9ff2fc44c401c Mon Sep 17 00:00:00 2001 From: Chris Arriola Date: Wed, 9 Mar 2022 15:23:00 -0800 Subject: [PATCH] feat!: Remove function literal with receiver. BREAKING CHANGE: Removes function literal receiver from await extensions that don't require it. Change-Id: If646464c26351a41114fb8390734f62f72ed80f9 --- .../android/libraries/places/ktx/api/net/PlacesClient.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/places-ktx/src/main/java/com/google/android/libraries/places/ktx/api/net/PlacesClient.kt b/places-ktx/src/main/java/com/google/android/libraries/places/ktx/api/net/PlacesClient.kt index 9eb5659..f869ea6 100644 --- a/places-ktx/src/main/java/com/google/android/libraries/places/ktx/api/net/PlacesClient.kt +++ b/places-ktx/src/main/java/com/google/android/libraries/places/ktx/api/net/PlacesClient.kt @@ -41,7 +41,7 @@ import kotlinx.coroutines.tasks.await @ExperimentalCoroutinesApi public suspend fun PlacesClient.awaitFetchPhoto( photoMetadata: PhotoMetadata, - actions: FetchPhotoRequest.Builder.() -> Unit + actions: FetchPhotoRequest.Builder.() -> Unit = {} ): FetchPhotoResponse { val cancellationTokenSource = CancellationTokenSource() val request = FetchPhotoRequest.builder(photoMetadata) @@ -61,12 +61,10 @@ public suspend fun PlacesClient.awaitFetchPhoto( public suspend fun PlacesClient.awaitFetchPlace( placeId: String, placeFields: List, - actions: FetchPlaceRequest.Builder.() -> Unit ): FetchPlaceResponse { val cancellationTokenSource = CancellationTokenSource() val request = FetchPlaceRequest.builder(placeId, placeFields) .setCancellationToken(cancellationTokenSource.token) - .apply(actions) .build() return this.fetchPlace(request).await(cancellationTokenSource) } @@ -100,13 +98,11 @@ public suspend fun PlacesClient.awaitFindAutocompletePredictions( ) @ExperimentalCoroutinesApi public suspend fun PlacesClient.awaitFindCurrentPlace( - placeFields: List, - actions: FindCurrentPlaceRequest.Builder.() -> Unit + placeFields: List ): FindCurrentPlaceResponse { val cancellationTokenSource = CancellationTokenSource() val request = FindCurrentPlaceRequest.builder(placeFields) .setCancellationToken(cancellationTokenSource.token) - .apply(actions) .build() return this.findCurrentPlace(request).await(cancellationTokenSource) }