You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If it were me, I'd probably be lazy and just drop the whole unsafe set. The user can always just do:
val nonEmpty = someList.nonEmptyOrNull() ?: error("Bug! I expected this to be non-empty!")
But if you keep both APIs, I suggest at least naming both sets with the "toNonEmptyFoo" style. A lot of methods in the Kotlin standard library have names like toList, so going with toNonEmptyList seems like a good match.
The text was updated successfully, but these errors were encountered:
For example, you have:
and
If it were me, I'd probably be lazy and just drop the whole unsafe set. The user can always just do:
But if you keep both APIs, I suggest at least naming both sets with the "toNonEmptyFoo" style. A lot of methods in the Kotlin standard library have names like
toList
, so going withtoNonEmptyList
seems like a good match.The text was updated successfully, but these errors were encountered: