Use dot notation for enum variants
This commit is contained in:
parent
ab783c33ed
commit
117d188194
13 changed files with 162 additions and 154 deletions
|
|
@ -109,9 +109,9 @@ enum PaymentResult {
|
|||
|
||||
fun describe(result: PaymentResult): String {
|
||||
return match (result) {
|
||||
PaymentResult::Accepted(id) -> id
|
||||
PaymentResult::Rejected(reason) -> reason
|
||||
PaymentResult::Pending -> "pending"
|
||||
PaymentResult.Accepted(id) -> id
|
||||
PaymentResult.Rejected(reason) -> reason
|
||||
PaymentResult.Pending -> "pending"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue