gpt4 book ai didi

rust - 无法使用git存储库中的alacritty依赖关系

转载 作者:行者123 更新时间:2023-12-03 11:41:50 24 4
gpt4 key购买 nike

我正在尝试使用alacritty作为来自Git的依赖项作为stated in the docs。我收到此错误:

error[E0432]: unresolved import `alacritty`
--> src\main.rs:1:5
|
1 | use alacritty;
| ^^^^^^^^^ no `alacritty` external crate
要创建 MRE,请使用 cargo new hello_world --bin创建一个新的Cargo项目,并将 main.rs替换为:
use alacritty;

fn main() {
println!("Hello world! :-)")
}
Cargo.toml与:
[package]
name = "my-project"
version = "0.1.0"
authors = ["rsheink"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
alacritty = { git = "https://github.com/alacritty/alacritty.git", tag = "v0.4.3" }

最佳答案

Alacritty是可执行文件。您不能将可执行文件用作依赖项,因为它们不是库。
作为Ömer Erden points out,agalritty uses another crate称为alacritty_terminal。也许这就是您想要的?如果没有,您可能希望与开发人员一起讨论一个问题,以解释您的需求并提出一种重组代码的方法。

关于rust - 无法使用git存储库中的alacritty依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62793835/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com