the trait bound `TableColor: From<crossterm::style::Color>` is not satisfied

Offen
#218 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
35/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
rust
Bereich
cli

Rechercherichtung

Beginne mit der gemeldeten Zeile 59 in click.rs und Zeile 65 in table.rs und untersuche anschließend die Auflösung der Abhängigkeiten des Projekts für die von click und comfy_table verwendeten crossterm-Versionen. Bestätige, dass die Abhängigkeitsversionen kompatibel sind, und verifiziere, dass cargo install click ohne die gemeldeten Typ- und Trait-Fehler kompiliert.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Hi, I might these 2 errors when installing Click on my laptop, could someone help to take a look?

error[E0277]: the trait bound `TableColor: From<crossterm::style::Color>` is not satisfied
  --> /Users/xxx.cargo/registry/src/github.com-1ecc6299db9ec823/click-0.6.2/src/command/click.rs:59:55
   |
59 |                 Some(env.styles.context_table_color().into()),
   |                                                       ^^^^ the trait `From<crossterm::style::Color>` is not implemented for `TableColor`
   |
   = help: the following other types implement trait `From<T>`:
             <TableColor as From<ColorType>>
             <TableColor as From<comfy_table::Color>>
   = note: required for `crossterm::style::Color` to implement `Into<TableColor>`

error[E0308]: mismatched types
  --> /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/click-0.6.2/src/table.rs:65:36
   |
61 |     fn to_color(&self, env: &Env) -> Color {
   |                                      ----- expected `comfy_table::Color` because of return type
...
65 |                 ColorType::Info => env.styles.info_color(),
   |                                    ^^^^^^^^^^^^^^^^^^^^^^^ expected `comfy_table::Color`, found `crossterm::style::Color`
   |
   = note: `crossterm::style::Color` and `comfy_table::Color` have similar names, but are actually distinct types
note: `crossterm::style::Color` is defined in crate `crossterm`
  --> /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/crossterm-0.25.0/src/style/types/color.rs:28:1
   |
28 | pub enum Color {
   | ^^^^^^^^^^^^^^
note: `comfy_table::Color` is defined in crate `crossterm`
  --> /Users/xxx/.cargo/registry/src/github.com-1ecc6299db9ec823/crossterm-0.26.1/src/style/types/color.rs:28:1
   |
28 | pub enum Color {
   | ^^^^^^^^^^^^^^
   = note: perhaps two different versions of crate `crossterm` are being used?

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `click` due to 2 previous errors
error: failed to compile `click v0.6.2`, intermediate artifacts can be found at `/var/folders/04/jlt2yd8n07x9np7x2lph9ghh0000gp/T/cargo-installuJD6gf`
Vorherrschende Sprache
Rust
Sterne
1.5k
Forks
93
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus databricks/click

Alle Issues in databricks/click

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.