dfinity / agent-rs

A collection of libraries and tools for building software around the Internet Computer, in Rust.

Home Page:https://sdk.dfinity.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

could not compile `ic-agent` (lib) due to 2 previous errors

witter-deland opened this issue · comments

target wasm32-unknown-unknown

ic-agent-0.25.0/src/agent/mod.rs:556:19
    |
556 |             match retry_policy.next_backoff() {
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Some(_)` not covered
    |
note: `std::option::Option<std::time::Duration>` defined here
   --> .rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/option.rs:572:5
    |
564 | pub enum Option<T> {
    | ------------------
...
572 |     Some(#[stable(feature = "rust1", since = "1.0.0")] T),
    |     ^^^^ not covered
    = note: the matched value is of type `std::option::Option<std::time::Duration>`
help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown
    |
576 ~                 None => return Err(AgentError::TimeoutWaitingForResponse()),
577 ~                 Some(_) => todo!(),
    |

error[E0308]: mismatched types
ic-agent-0.25.0/src/agent/http_transport/reqwest_transport.rs:36:47
   |
36 |     pub fn create<U: Into<String>>(url: U) -> Result<Self, AgentError> {
   |            ------                             ^^^^^^^^^^^^^^^^^^^^^^^^ expected `Result<ReqwestTransport, AgentError>`, found `()`
   |            |
   |            implicitly returns `()` as its body has no tail or `return` expression
   |
   = note:   expected enum `Result<ReqwestTransport, AgentError>`
           found unit type `()`

You need the wasm-bindgen feature.

[dependencies]
ic-agent = { version = "0.25", features = ["wasm-bindgen"] }