From 14c44bf584cb7d13ada46b264419efca923ed65c Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Wed, 5 Aug 2020 19:02:24 +0530 Subject: Remove GitAsyncTask and replace with non-blocking coroutines (#865) Co-authored-by: Fabian Henneke --- app/src/main/java/com/zeapo/pwdstore/utils/Result.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/src/main/java/com/zeapo/pwdstore/utils/Result.kt (limited to 'app/src/main/java/com/zeapo/pwdstore/utils/Result.kt') diff --git a/app/src/main/java/com/zeapo/pwdstore/utils/Result.kt b/app/src/main/java/com/zeapo/pwdstore/utils/Result.kt new file mode 100644 index 00000000..d152cba6 --- /dev/null +++ b/app/src/main/java/com/zeapo/pwdstore/utils/Result.kt @@ -0,0 +1,16 @@ +/* + * Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved. + * SPDX-License-Identifier: GPL-3.0-only + */ + +package com.zeapo.pwdstore.utils + +/** + * Emulates the Rust Result enum but without returning a value in the [Ok] case. + * https://doc.rust-lang.org/std/result/enum.Result.html + */ +sealed class Result { + + object Ok : Result() + data class Err(val err: Exception) : Result() +} -- cgit v1.2.3