Skip to content

Commit 9aefeb2

Browse files
author
Vojin Jovanovic
committed
Fixing missing import.
1 parent 00c5218 commit 9aefeb2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sips/pending/_posts/2012-01-21-futures-promises.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -689,18 +689,20 @@ Abstract `Duration` contains methods that allow :
689689
For example `val d = Duration(100, MILLISECONDS)`.
690690
3. By parsing a string that represent a time period. For example `val d = Duration("1.2 µs")`.
691691

692+
Duration also provides `unapply` methods so it can be used in pattern matching constructs.
692693
Examples:
693694

694695
import scala.concurrent.util.Duration
696+
import scala.concurrent.util.duration._
695697
import java.util.concurrent.TimeUnit._
696698

699+
// instantiation
697700
val d1 = Duration(100, MILLISECONDS) // from Long and TimeUnit
698701
val d2 = Duration(100, "millis") // from Long and String
699702
val d3 = 100 millis // implicitly from Long, Int or Double
700703
val d4 = Duration("1.2 µs") // from String
701704

702-
Duration also provides `unapply` methods so it can be used in pattern matching constructs as follows:
703-
705+
// pattern matching
704706
val Duration(length, unit) = 5 millis
705707

706708
<!--

0 commit comments

Comments
 (0)