Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
Foso committed Aug 26, 2024
1 parent 0ce0f4f commit 4ac9ca3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,12 @@ public class Ktorfit private constructor(
/**
* Creates an instance of Ktorfit with specified baseUrl and HttpClient.
*/
public fun build(): Ktorfit {
return Ktorfit(
public fun build(): Ktorfit =
Ktorfit(
baseUrl = _baseUrl,
httpClient = _httpClient ?: HttpClient(),
converterFactories = _factories.toList() + listOf(DefaultSuspendResponseConverterFactory()),
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ public interface Converter<F, T> {
public fun getUpperBoundType(
index: Int,
type: TypeData,
): TypeData? {
return type.typeArgs[index]
}
): TypeData? = type.typeArgs[index]

public interface Factory {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ public sealed interface KtorfitResult {
* Represents a successful response.
* @property response The HTTP response.
*/
public class Success(public val response: HttpResponse) : KtorfitResult
public class Success(
public val response: HttpResponse
) : KtorfitResult

/**
* Represents a failed response.
* @property throwable The throwable associated with the failure.
*/
public class Failure(public val throwable: Throwable) : KtorfitResult
public class Failure(
public val throwable: Throwable
) : KtorfitResult
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import kotlin.reflect.cast
* Cant make this internal because it is used by generated code
*/
@InternalKtorfitApi
public class KtorfitConverterHelper(private val ktorfit: Ktorfit) {
public class KtorfitConverterHelper(
private val ktorfit: Ktorfit
) {
private val httpClient: HttpClient = ktorfit.httpClient

/**
Expand Down

0 comments on commit 4ac9ca3

Please sign in to comment.