We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 12b77b3 commit 5fc9d89Copy full SHA for 5fc9d89
[refs]
@@ -1,5 +1,5 @@
1
---
2
-refs/heads/master: 055158d05191000384b490399c104394cbc0c838
+refs/heads/master: d53e633bd5f9f733fb49ce556d16058baa1453f5
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
trunk/src/test/run-pass/swappable-test.rs
@@ -0,0 +1,13 @@
+import swappable::{swappable, methods};
+
+fn main() {
+ let d = swappable(3);
+ 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
12
+ assert swappable::unwrap(d) == 5;
13
+}
0 commit comments