Closures

オープン
#1,746 コメント 8 件 リアクション 2 件 担当者 0 名 GitHub で見る

@junderw がすでに取り組んでいます。

2024年9月2日 から。

  • #2099 @junderw による — オープン

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
32/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust
領域
documentation

調査の方向性

ファイル、テスト、エントリーポイントは指定されていません。まず既存のレッスン構成と Rustlings の演習の範囲の決め方を確認し、そのうえで提案されている closure、Fn* trait、async-block のトピックが適合するかを評価してください。完了条件は、スコープについて合意し、列挙された 4 つの領域を扱うレビュー済みのレッスンを追加することです。

索引モデルが issue の本文から書いたものです。

説明

A-exercises C-new-exercise P-medium

One topic I see new people hit pretty early on is the capturing semantics and the Fn* traits.

I was thinking of adding a few lessons to show:

  1. Capturing semantics without move
  2. Capturing semantics with move (including ie. binding a reference to a variable before using it in the closure and a reference is moved)
  3. How the Fn* traits are auto-implemented.
  4. Briefly mention that async block capturing is similar to closure capturing, but that there is no Fn* traits for async-block-futures.

I wanted to read the room a bit before actually putting time into this. Do we think this might be a bit too advanced for rustlings? Would it depend on the actual content? Would anyone be willing to help review my lessons to try and get it over the finish line?

It's an issue I get asked about constantly, especially when dealing with GUI frameworks like egui that make use of lots of nested closures... it might help people intuit these issues more clearly.

Let me know what you think!

主要言語
Rust
スター
64.8k
フォーク
11.3k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-lang/rustlings のほかの issue

rust-lang/rustlings の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。