Horryportier / md-to-tui

markdown to ratatui parser
MIT License
3 stars 1 forks source link

ratatui Version issue #6

Open FreeMasen opened 8 months ago

FreeMasen commented 8 months ago

Because this crate returns ratatui::text::Text, as ratatui evolves the types here don't line-up with future version. For example at this point you can do something like

fn render_text(s: &str) -> Text {
    md_to_tui::MarkdownParsable::parse_markdown(&some, None).unwrap_or_else(|_| {
        Text::raw(s)
    })
}

will fail if the crate consuming this crate us using a different version of ratatui, right now this would provide an error like the following

error[E0308]: mismatched types
   --> src/work.rs:199:13
    |
3 | /             Text::raw(s)
    | |______________^ expected `ratatui::text::Text<'_>`, found `Text<'_>`
    |
    = note: `Text<'_>` and `ratatui::text::Text<'_>` have similar names, but are actually distinct types
note: `Text<'_>` is defined in crate `ratatui`

I am not sure what the right way to fix this but I wanted to report it as I ran into it today.

Horryportier commented 8 months ago

thanks for telling me about it. I kinda forgot about this crate. I don't know if i will be working on it anymore. But for now if you want make any changes to fix it feel free and, then I can merge it.