ok how would format the following method? consider...
# getting-started
j
ok how would format the following method? considering convention/readability
Copy code
fun <T : View> setMargin(view: T, left: Int? = null, top: Int? = null, right: Int? = null, bottom: Int? = null) {
    val layoutParams = view.layoutParams as? ViewGroup.MarginLayoutParams ?: return
    layoutParams.setMargins(left ?: layoutParams.leftMargin, top ?: layoutParams.topMargin, right ?: layoutParams.rightMargin, bottom ?: layoutParams.rightMargin)
    view.layoutParams = layoutParams
}