File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
branches/try/src/test/run-pass Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: 055158d05191000384b490399c104394cbc0c838
5
+ refs/heads/try: d53e633bd5f9f733fb49ce556d16058baa1453f5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change
1
+ import swappable :: { swappable, methods} ;
2
+
3
+ fn main ( ) {
4
+ let d = swappable ( 3 ) ;
5
+ assert d. get ( ) == 3 ;
6
+ d. set ( 4 ) ;
7
+ assert d. get ( ) == 4 ;
8
+ d. swap { |i| i + 1 } ;
9
+ assert d. get ( ) == 5 ;
10
+ assert d. with { |i| i + 1 } == 6 ;
11
+ assert d. get ( ) == 5 ;
12
+ assert swappable:: unwrap ( d) == 5 ;
13
+ }
You can’t perform that action at this time.
0 commit comments