File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,10 @@ impl Drop for HasDrop {
21
21
fn main () {
22
22
let x = HasDrop ;
23
23
24
+ # // do stuff
24
25
// いくつかの処理
25
26
27
+ # // } // x goes out of scope here
26
28
} // x はここでスコープ外になります
27
29
```
28
30
@@ -35,7 +37,7 @@ fn main() {
35
37
<!-- That’s it! The mechanics of `Drop` are very simple, but there are some -->
36
38
<!-- subtleties. For example, values are dropped in the opposite order they are -->
37
39
<!-- declared. Here’s another example: -->
38
- これだけです! ` Drop ` のメカニズムは非常にシンプルです、しかし少しだけ重要な点があります 。
40
+ これだけです! ` Drop ` のメカニズムは非常にシンプルです、しかし少しだけ注意すべき点があります 。
39
41
たとえば、値がドロップされる順序は、それらが定義された順序と反対の順序になります:
40
42
41
43
``` rust
@@ -65,7 +67,7 @@ BOOM times 1!!!
65
67
66
68
<!-- The TNT goes off before the firecracker does, because it was declared -->
67
69
<!-- afterwards. Last in, first out. -->
68
- TNTが爆竹が鳴る前に爆発してしまいました 、これはTNTが定義されたのは爆竹よりも後だったことによります。
70
+ TNTが爆竹(firecracker)が鳴る前に爆発してしまいました 、これはTNTが定義されたのは爆竹よりも後だったことによります。
69
71
ラストイン・ファーストアウトです。
70
72
71
73
<!-- So what is `Drop` good for? Generally, `Drop` is used to clean up any resources -->
You can’t perform that action at this time.
0 commit comments