Skip to content

Commit

Permalink
refactor(conan): Turn parseSourceArtifact() into an expression
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Viernau <[email protected]>
  • Loading branch information
fviernau committed Jul 17, 2024
1 parent bbdbf10 commit 5c6322a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugins/package-managers/conan/src/main/kotlin/Conan.kt
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ class Conan(
* Return the source artifact contained in [conanData], or [RemoteArtifact.EMPTY] if no source artifact is
* available.
*/
private fun parseSourceArtifact(conanData: Map<String, JsonNode>): RemoteArtifact {
return runCatching {
private fun parseSourceArtifact(conanData: Map<String, JsonNode>): RemoteArtifact =
runCatching {
val artifactEntry = conanData.getValue("sources")

val url = artifactEntry["url"].let { urlNode ->
Expand All @@ -401,7 +401,6 @@ class Conan(
}.getOrElse {
RemoteArtifact.EMPTY
}
}

/**
* Return a [Package] containing project-level information depending on which [definitionFile] was found:
Expand Down

0 comments on commit 5c6322a

Please sign in to comment.