the trait bound `TableColor: From<crossterm::style::Color>` is not satisfied
还没有人认领这个 Issue。
评估
调研方向
从报告中的 click.rs 第 59 行和 table.rs 第 65 行开始,然后检查项目针对 click 和 comfy_table 所使用的 crossterm 版本进行的依赖解析。确认依赖版本兼容,并验证 cargo install click 可以编译且不会出现报告中的类型和 trait 错误。
由索引模型根据 Issue 内容生成。
描述
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`
- 主要语言
- Rust
- 星标
- 1.5k
- 派生
- 93
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
databricks/click 的其他 Issue
-
Click未关闭
难度 5/5 一周以上 新手友好度 15/100
databricks/click#237 ·
-
难度 3/5 1-2 天 新手友好度 35/100
databricks/click#234 ·
-
难度 3/5 1-2 天 新手友好度 45/100
databricks/click#233 ·
-
难度 4/5 3-5 天 新手友好度 35/100
databricks/click#227 ·
-
难度 5/5 一周以上 新手友好度 20/100
databricks/click#213 · 1 个 reaction ·
相似的 Issue
-
enhancement feature review: low Sonnet ui
难度 2/5 1-3 小时 新手友好度 62/100
MMFoundation/WallpaperMachine#190 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 63/100
servo/rust-smallvec#877 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
cloudflare/workers-rs#1140 ·
维护者通常 7 天内回复
-
A-documentation S-needs-triage
难度 1/5 1 小时以内 新手友好度 88/100
Quantinuum/hugr#3344 ·
维护者通常 1 天内回复
-
P4
难度 2/5 1-3 小时 新手友好度 78/100
HerringtonDarkholme/hd-lang#1718 · 1 条评论 ·
维护者通常 1 天内回复