Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to crossterm 0.20.0 #29

Closed
EverlastingBugstopper opened this issue Jun 21, 2021 · 5 comments
Closed

Update to crossterm 0.20.0 #29

EverlastingBugstopper opened this issue Jun 21, 2021 · 5 comments

Comments

@EverlastingBugstopper
Copy link
Contributor

When using crossterm 0.20.0 with termimad 0.11.1, I get the following error:

error[E0308]: mismatched types
   --> src/command/output.rs:125:36
    |
125 |                 skin.bold.add_attr(Underlined);
    |                                    ^^^^^^^^^^ expected enum `crossterm::style::types::attribute::Attribute`, found enum `crossterm::style::Attribute`
    |
    = note: perhaps two different versions of crate `crossterm` are being used?

error[E0308]: mismatched types
   --> src/command/output.rs:125:36
    |
125 |                 skin.bold.add_attr(Underlined);
    |                                    ^^^^^^^^^^ expected enum `crossterm::style::types::attribute::Attribute`, found enum `crossterm::style::Attribute`
    |
    = note: perhaps two different versions of crate `crossterm` are being used?

It looks to me as if there were some breaking changes in the crossterm crate that just moved where the types live. termimad should update their API to accept this new type, and possibly consider re-exporting the types that are expected to be used within the skin builder API so consumer crates don't have to worry about matching dependency versions.

@Canop
Copy link
Owner

Canop commented Jun 21, 2021

I'm not sure about reexporting. When you use termimad, you probably also directly use crossterm.

@EverlastingBugstopper
Copy link
Contributor Author

EverlastingBugstopper commented Jun 21, 2021

Yeah, that part is definitely not necessary to fix this - just a possible path. I only suggest it since the termimad API directly accepts input parameters thats types are not part of this crate. An example of this pattern in the ecosystem is reqwest which re-exports the types from the http crate so you don't have to include it as a dependency.

@Canop
Copy link
Owner

Canop commented Jun 21, 2021

I also often reexport types in my crates, but mostly when you don't need to use the other types directly.
My opinion isn't yet made on this point.

@Canop
Copy link
Owner

Canop commented Jun 24, 2021

done: versions of Termimad 0.12.x are based on Crossterm 0.20

@EverlastingBugstopper
Copy link
Contributor Author

Thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants