Add Rust reference comments for on{Success,Failure}
This commit is contained in:
parent
05d50b7fec
commit
73a71154e9
@ -5,6 +5,8 @@ import kotlin.contracts.contract
|
||||
|
||||
/**
|
||||
* Invokes an [action] if this [Result] is [Ok].
|
||||
*
|
||||
* - Rust: [Result.inspect](https://doc.rust-lang.org/std/result/enum.Result.html#method.inspect)
|
||||
*/
|
||||
public inline infix fun <V, E> Result<V, E>.onSuccess(action: (V) -> Unit): Result<V, E> {
|
||||
contract {
|
||||
@ -20,6 +22,8 @@ public inline infix fun <V, E> Result<V, E>.onSuccess(action: (V) -> Unit): Resu
|
||||
|
||||
/**
|
||||
* Invokes an [action] if this [Result] is [Err].
|
||||
*
|
||||
* - Rust [Result.inspect_err](https://doc.rust-lang.org/std/result/enum.Result.html#method.inspect_err)
|
||||
*/
|
||||
public inline infix fun <V, E> Result<V, E>.onFailure(action: (E) -> Unit): Result<V, E> {
|
||||
contract {
|
||||
|
Loading…
Reference in New Issue
Block a user