ivmarkov / rust-esp32-std-demo

Rust on ESP32 STD demo app. A demo STD binary crate for the ESP32[XX] and ESP-IDF, which connects to WiFi, Ethernet, drives a small HTTP server and draws on a LED screen.
Apache License 2.0
784 stars 105 forks source link

Fix ttgo feature #91

Closed pyaillet closed 2 years ago

pyaillet commented 2 years ago

Without this, a cargo c --features "ttgo" fails with:

error[E0308]: mismatched types
   --> src/main.rs:809:5
    |
768 | ) -> Result<()> {
    |      ---------- expected `std::result::Result<(), anyhow::Error>` because of return type
...
809 |     led_draw(&mut display.cropped(&Rectangle::new(top_left, size)))
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `anyhow::Error`, found enum `st7789::Error`
    |
    = note: expected enum `std::result::Result<_, anyhow::Error>`
               found enum `std::result::Result<_, st7789::Error<EspError>>`

I included fixes for heltec, kaluga, ...

pyaillet commented 2 years ago

Sorry for the missing cargo fmt. I should add a git pre-commit hook I guess :\