Skip to content

Commit 1f03149

Browse files
author
Will Palmeri
committed
move case ordering section after match statements
1 parent 94f15f0 commit 1f03149

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,13 @@ Option(123) match {
398398
}
399399
```
400400

401+
## Case Ordering
402+
403+
As a general practice, the ordering of case statements should be prioritized from most likely to be the executed to least likely.
404+
For example, if you expect a `Try` to generally succeed, the first case in the match should be `Success(s)`, followed by `Failure(f)`.
405+
406+
The same goes for if/else statements, naturally.
407+
401408
## Option
402409

403410
Flows with `Option` values should be constructed using the `match` keyword as follows.
@@ -475,13 +482,6 @@ for {
475482
}
476483
```
477484

478-
## Case Ordering
479-
480-
As a general practice, the ordering of case statements should be prioritized from most likely to be the executed to least likely.
481-
For example, if you expect a `Try` to generally succeed, the first case in the match should be `Success(s)`, followed by `Failure(f)`.
482-
483-
The same goes for if/else statements, naturally.
484-
485485
# Akka
486486

487487
## Ask and Tell

0 commit comments

Comments
 (0)