mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-03 16:10:00 +00:00
Inject constructor.
This commit is contained in:
+2
-1
@@ -20,13 +20,14 @@ import com.squareup.anvil.annotations.ContributesBinding
|
|||||||
import io.element.android.libraries.di.AppScope
|
import io.element.android.libraries.di.AppScope
|
||||||
import org.matrix.rustcomponents.sdk.ElementWellKnown
|
import org.matrix.rustcomponents.sdk.ElementWellKnown
|
||||||
import org.matrix.rustcomponents.sdk.makeElementWellKnown
|
import org.matrix.rustcomponents.sdk.makeElementWellKnown
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
interface ElementWellKnownParser {
|
interface ElementWellKnownParser {
|
||||||
fun parse(str: String): Result<ElementWellKnown>
|
fun parse(str: String): Result<ElementWellKnown>
|
||||||
}
|
}
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
class RustElementWellKnownParser : ElementWellKnownParser {
|
class RustElementWellKnownParser @Inject constructor() : ElementWellKnownParser {
|
||||||
override fun parse(str: String): Result<ElementWellKnown> {
|
override fun parse(str: String): Result<ElementWellKnown> {
|
||||||
return runCatching {
|
return runCatching {
|
||||||
makeElementWellKnown(str)
|
makeElementWellKnown(str)
|
||||||
|
|||||||
Reference in New Issue
Block a user