lapce / floem

A native Rust UI library with fine-grained reactivity
https://docs.rs/floem
MIT License
2.53k stars 114 forks source link

Counter example doesn't compile #434

Open sphinxc0re opened 1 month ago

sphinxc0re commented 1 month ago

I'm was trying to use the library but couldn't get past the compilation of tiny_skia. I'm getting the following error with Rust 1.75 as well as 1.78:

error[E0308]: mismatched types
   --> tiny_skia/src/lib.rs:422:58
    |
422 |                 let pixmap = self.cache_glyph(cache_key, glyph_run.color);
    |                                   -----------            ^^^^^^^^^^^^^^^ expected `floem_peniko::Color`, found `peniko::color::Color`
    |                                   |
    |                                   arguments to this method are incorrect
    |
    = note: `peniko::color::Color` and `floem_peniko::Color` have similar names, but are actually distinct types
note: `peniko::color::Color` is defined in crate `peniko`
   --> [REDACTED]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/peniko-0.1.0/src/color.rs:12:1
    |
12  | pub struct Color {
    | ^^^^^^^^^^^^^^^^
note: `floem_peniko::Color` is defined in crate `floem_peniko`
   --> [REDACTED]/.cargo/registry/src/index.crates.io-6f17d22bba15001f/floem-peniko-0.1.0/src/color.rs:9:1
    |
9   | pub struct Color {
    | ^^^^^^^^^^^^^^^^
note: method defined here
   --> tiny_skia/src/lib.rs:297:8
    |
297 |     fn cache_glyph(&mut self, cache_key: CacheKey, color: Color) -> Option<Rc<Glyph>> {
    |     

Then I tried just running the example and that didn't work, so here I am 😅

EDIT: Getting the same error in the released version as well as main. Don't know how that works, you shouldn't be able to release something to crates.io that doesn't compile.

panekj commented 1 month ago

It will be fixed by #432 Use cargo update --package floem-cosmic-text --precise 0.7.1 to fix it