Skip to content

Commit 72b06bc

Browse files
Apply use extension
Also: * Fix wording in KDoc.
1 parent f33bc6d commit 72b06bc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomFormatting.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ internal object PomFormatting {
9292
* Writes the specified lines using the specified [destination], dividing them
9393
* by platform-specific line separator.
9494
*
95-
* The written lines are also padded with platform's line separator from both sides
95+
* The written lines are also padded with the platform's line separator from both sides.
9696
*/
9797
internal fun writeBlocks(destination: StringWriter, vararg lines: String) {
9898
lines.iterator().forEach {

buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomXmlWriter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ internal constructor(
5555
*/
5656
fun writeTo(file: File) {
5757
val out = StringWriter()
58-
5958
writeStart(out)
6059
writeBlocks(
6160
out,
@@ -66,8 +65,9 @@ internal constructor(
6665
)
6766
PomFormatting.writeEnd(out)
6867

69-
fileWriter.write(out.toString())
70-
fileWriter.close()
68+
FileWriter(file).use {
69+
it.write(out.toString())
70+
}
7171
}
7272

7373
/**

0 commit comments

Comments
 (0)