Convert data class to Poko (#242)

This commit is contained in:
Jake Wharton
2023-11-13 13:40:37 -05:00
committed by GitHub
parent 8123702fa9
commit 6da826625c

View File

@ -3,6 +3,7 @@ package com.jakewharton.mosaic.text
import androidx.compose.runtime.Immutable import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable import androidx.compose.runtime.Stable
import com.jakewharton.mosaic.text.AnnotatedString.Builder import com.jakewharton.mosaic.text.AnnotatedString.Builder
import dev.drewhamilton.poko.Poko
/** /**
* The basic data structure of text with multiple styles. To construct an [AnnotatedString] you * The basic data structure of text with multiple styles. To construct an [AnnotatedString] you
@ -79,8 +80,8 @@ public class AnnotatedString internal constructor(
* @param start The start of the range where [item] takes effect. It's inclusive * @param start The start of the range where [item] takes effect. It's inclusive
* @param end The end of the range where [item] takes effect. It's exclusive * @param end The end of the range where [item] takes effect. It's exclusive
*/ */
@Immutable @[Immutable Poko]
public data class Range<T>(val item: T, val start: Int, val end: Int) { public class Range<T>(public val item: T, public val start: Int, public val end: Int) {
init { init {
require(start <= end) { "Reversed range is not supported" } require(start <= end) { "Reversed range is not supported" }