検索
Results of 1 - 1 of about 1 for losure (0.004 sec.)
- 要素の捕捉 - Rust By Example 日本語版 9414
- Introduction 1. Hello World ❱ 1.1. コメント 1.2. フォーマットしてプリント ❱ 1.2.1. デバッグ 1.2.
...
std::mem; let color = String::from("green"); // A closure to print `color` which immediately borrows (`&`) `...
color` and // stores the borrow and closure in the `print` variable. It will remain // borrowe...
= || println!("`color`: {}", color); // Call the closure using the borrow. // 借用を行ったクロージャをコール...
lor` can be borrowed immutably again, because the closure only holds // an immutable reference to `color`. /...
- https://man.plustar.jp/rust/example/fn/closures/capture.html - [similar]
PREV
1
NEXT