Skip to content

Commit

Permalink
Omit explicit this in extension function
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshiRulz committed Oct 18, 2022
1 parent f77366a commit 0466eac
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private inline fun <T> wrapExceptions(block: () -> T): T =
}

private fun LocalDateTime.toTrackFilename(): String {
fun Int.f(len: Int): String = this.toString().padStart(len, '0')
return ("${this.year.f(4)}_${this.monthNumber.f(2)}_${this.dayOfMonth.f(2)}"
+ "T${this.hour.f(2)}_${this.minute.f(2)}_${this.second.f(2)}.${this.nanosecond.f(6)}Z.gpx")
fun Int.f(len: Int): String = toString().padStart(len, '0')
return ("${year.f(4)}_${monthNumber.f(2)}_${dayOfMonth.f(2)}"
+ "T${hour.f(2)}_${minute.f(2)}_${second.f(2)}.${nanosecond.f(6)}Z.gpx")
}

0 comments on commit 0466eac

Please sign in to comment.