Add ProtobufExtensions

This commit is contained in:
José Rebelo
2025-08-10 20:10:28 +01:00
parent bb710bae92
commit 2672295dfc
@@ -0,0 +1,9 @@
package nodomain.freeyourgadget.gadgetbridge.util.protobuf
import com.google.protobuf.GeneratedMessageLite
inline fun <T, B : GeneratedMessageLite.Builder<T, B>> B.buildWith(block: B.() -> Unit): T {
this.apply(block)
@Suppress("UNCHECKED_CAST")
return this.build() as T
}