Allow extra fields when using #[from] (using Default trait)
まだ誰も着手していません。
評価
調査の方向性
まず #[from] の展開と生成される From 実装を確認し、次にエラーへのコンテキスト追加に関する過去の issue を確認します。デフォルト値が設定された追加フィールド、またはオプションの #[from] パラメーターについて、受け入れる動作について合意されて実装され、crate が意図するシンプルさを変更していなければ、作業は完了です。
索引モデルが issue の本文から書いたものです。
説明
It would be useful to allow extra fields in the structs when using #[from], to optionally add additional context. I think that could be achieved by simply initializing them with Default::default() in the From implementation, and allowing user to add the context to errors later (e.g. with another derive macro from a different crate).
I could provide a PR that implement it, but I saw from some previous issues that you're somewhat against the idea of supporting adding context to the errors, so I want to make sure you're on board with this before I spend more time on it.
I believe that my proposal is minimally intrusive, and maintains the spirit of simplicity of this crate. If this would stray too much from the current interface, how about adding optional parameter to #[from], e.g. #[from(with_defaults)], that would trigger this behavior?
- 主要言語
- Rust
- スター
- 5.6k
- フォーク
- 220
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dtolnay/thiserror のほかの issue
-
Improve #[from] documentation example.対応中かも @SatvikMishra08 が 50 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
No `unused field` warnings are produced on enums deriving thiserror::Error対応中かも @usmanovbf が 240 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
example from documentation does not compile再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
dtolnay/thiserror の issue をすべて見る
似ている issue
-
Selected chart highlights only its values, not its series names and category labels対応中かも @Higgs32584 が今日担当しました。 オープンbug priority: low ui
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
storytold/gridcraft#4390 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
bug bugfix priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
quarto-dev/q2#1219 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100