Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

try_sign_digest() is confusing.

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

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
静か
技術スタック
rust
領域
cryptography

調査の方向性

signer.rs:110 付近にある DigestSigner::try_sign_digest の宣言から始め、その Rust 3.x のドキュメントを、リンク先の 2.x の DigestSigner ドキュメントと比較してください。digest を渡すことと、現在のメソッドが想定する callback を渡すことの違いを、既存の API でサポートされている例だけを使って明確にしてください。メソッドのコメントがもはや相互に置き換え可能に見えず、呼び出し側がどのように進めるべきかを説明していれば完了です。

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

説明

As of 3.0.0 the try_sign_digest method is now confusing enough to be unusable.

Previously in 2.x try_sign_digest took a Digest output for signing per https://docs.rs/signature/2.3.0-pre.7/signature/trait.DigestSigner.html

However in 3.x this now takes an fn mut, and it's not clear how this works. To make matters worse the doc comments are practically identical. This leads to update errors such as:

error[E0277]: expected a `Fn(&mut _)` closure, found `sha2::Sha256`
    --> src/lib.rs:1010:30
     |
1010 |             .try_sign_digest(digest)
     |              --------------- ^^^^^^ expected an `Fn(&mut _)` closure, found `sha2::Sha256`
     |              |
     |              required by a bound introduced by this call
     |
     = help: the trait `for<'a> Fn(&'a mut _)` is not implemented for `sha2::Sha256`
note: required by a bound in `try_sign_digest`
    --> /Users/william/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/signature-3.0.0/src/signer.rs:110:27
     |
 110 |     fn try_sign_digest<F: Fn(&mut D) -> Result<(), Error>>(&self, f: F) -> Result<S, Error>;
     |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `DigestSigner::try_sign_digest`

But there is no clear or actionable method to proceed as there is no way to pass the digest to this function.

主要言語
Rust
スター
760
フォーク
258
平均マージ
2時間 53分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

RustCrypto/traits のほかの issue

RustCrypto/traits の issue をすべて見る

似ている issue

Rust の issue をもっと見る

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

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