Code Monkey home page Code Monkey logo

Comments (4)

SergioGasquez avatar SergioGasquez commented on June 5, 2024 1

All the code and examples should now build successfully with no changes. CI now covers both the starting code and the examples folder with the “solutions” to it.

from std-training.

Narukara avatar Narukara commented on June 5, 2024

Same as #127. Try adding ignore = "=0.4.11" to Cargo.toml like #128 did.

from std-training.

davidstelter avatar davidstelter commented on June 5, 2024

Thanks, that got me past one set of errors, but there are more that follow (warnings removed for brevity):
cargo build --release --example http_client

Compiling esp32-c3-dkc02-bsc v0.1.0 (/Users/stelterd/code/ferrous-systems/espressif-trainings/espressif-trainings/common/lib/esp32-c3-dkc02-bsc)

error[E0599]: no method named `submit` found for struct `EspHttpRequestWrite` in the current scope
  --> examples/http_client.rs:50:31
   |
50 |     let mut response = writer.submit()?;
   |                               ^^^^^^ method not found in `EspHttpRequestWrite<'_>`

error[E0191]: the value of the associated type `Error` (from trait `Errors`) must be specified
  --> examples/http_client.rs:62:35
   |
62 |                 if let Ok(size) = Read::read(&mut reader, &mut buf){
   |                                   ^^^^ help: specify the associated type: `Read<Error = Type>`

error[E0599]: no function or associated item named `read` found for trait object `dyn embedded_svc::io::Read` in the current scope
  --> examples/http_client.rs:62:41
   |
62 |                 if let Ok(size) = Read::read(&mut reader, &mut buf){
   |                                         ^^^^ function or associated item not found in `dyn embedded_svc::io::Read`

Some errors have detailed explanations: E0191, E0599.
For more information about an error, try `rustc --explain E0191`.
warning: `http-client` (example "http_client") generated 4 warnings
error: could not compile `http-client` due to 3 previous errors; 4 warnings emitted

from std-training.

Narukara avatar Narukara commented on June 5, 2024

It seems that there is some problem with the code in the example. I made some changes to it and it works for me now. Here is the modified code:

...

let response = write.into_response()?;

...

match status {
    200..=299 => {
        let mut buf = [0_u8; 256];
        let mut reader = response.reader();
        loop {
            match reader.do_read(&mut buf) {
                Ok(size) if size > 0 => {
                    total_size += size;
                    let response_text = str::from_utf8(&buf[..size])?;
                    println!("{}", response_text);
                }
                _ => break,
            }
        }
    }
    _ => anyhow::bail!("unexpected response code: {}", status),
}

...

I think it is necessary to submit a PR to fix this issue.

from std-training.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.