Skip to content

Commit

Permalink
fix: update-agent build (#306)
Browse files Browse the repository at this point in the history
The build fails with error:

> error[E0599]: the method `as_dyn_error` exists for reference `&Error`, but its trait bounds were not satisfied
>   --> update-agent/core/src/pubkeys.rs:76:21
>    |
> 76 |     InvalidPubKey(#[from] SignatureError),
>    |                     ^^^^ method cannot be called on `&Error` due to unsatisfied trait bounds
>    |
>   ::: /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/signature-2.2.0/src/error.rs:26:1
>    |
> 26 | pub struct Error {
>    | ---------------- doesn't satisfy `ed25519_dalek::ed25519::Error: AsDynError<'_>` or `ed25519_dalek::ed25519::Error: StdError`
>    |
>    = note: the following trait bounds were not satisfied:
>            `ed25519_dalek::ed25519::Error: StdError`
>            which is required by `ed25519_dalek::ed25519::Error: AsDynError<'_>`
>            `&ed25519_dalek::ed25519::Error: StdError`
>            which is required by `&ed25519_dalek::ed25519::Error: AsDynError<'_>`

That happens because `ed25519_dalek::SignatureError` implements
`std::error::Error` only if flag `std` is enabled [1]

[1] https://docs.rs/ed25519-dalek/latest/ed25519_dalek/type.SignatureError.html#impl-Error-for-Error
  • Loading branch information
alekseifedotov authored Dec 3, 2024
1 parent ee8c8cb commit 98eb255
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ color-eyre = "0.6.2"
console-subscriber = "0.4"
data-encoding = "2.3"
derive_more = { version = "0.99", default-features = false, features = ["display", "from"] }
ed25519-dalek = { version = "2.1.1", default-features = false }
ed25519-dalek = { version = "2.1.1", default-features = false, features = ["std"]}
eyre = "0.6.12"
ftdi-embedded-hal = { version = "0.22.0", features = ["libftd2xx", "libftd2xx-static"] }
futures = "0.3.30"
Expand Down

0 comments on commit 98eb255

Please sign in to comment.