mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Add ProtobufExtensions
This commit is contained in:
+9
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user