cargo
cargo配置文件记录
使用strip减小build包 windows上build后大小基本都是最小的了,因为没有使用静态链接。而linux上基本一个hello world就几兆大小 [package] name = "learn" version = "0.1.0" edition = "2021" [profile.r ......
cargo-make rust 任务执行以及构建工具
再学习nakago 框架的时候发现其使用了cargo-make 这个工具,但是很方便,类似make 的构建模式 包含的特性 依赖管理,别名支持,支持workspace 简单使用 安装 cargo install --force cargo-make 参考使用 创建一个cargo 项目 cargo n ......
配置cargo install 下载源
目录C:\Users\腾洁.cargo下创建config文件 然后写入 [source.crates-io] replace-with = 'tuna' [source.tuna] registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates ......
rust cargo config一个方便的功能
cargo 除了默认的cargo.toml 文件之外,我们还可以进行一些额外的配置,可以用来干一些比较有意思的事情 比如.cargo/config.toml 文件就比较方便,当我们在基于rust 开发webassembly的时候是需要执行target的 为了兼容选择的是wasm32-unknown- ......
Cargo国内源
[source.crates-io] registry = "https://github.com/rust-lang/crates.io-index" # 替换成你目的镜像源 replace-with = 'sjtu' # 清华大学 [source.tuna] registry = "https: ......
26_rust_cargo、crates.io
rust_cargo、crates.io 通过release profile自定义构建 release profile(发布配置):是预定义的,可自定义,可使用不用的配置,对代码编译拥有更多的控制。 每个profile的配置都独立于其它的profile。 cargo主要的两个profile: dev ......
cargo 异常散记0.1
导入依赖 网络相关 Unsupported proxy scheme for xxxxx 异常报错信息: rust spurious network error (3 tries remaining): [7] Couldn't connect to server (Unsupported prox ......
Rust cargo常用命令
目录设置国内镜像创建新项目构建项目运行项目检查项目,但不构建可执行文件运行项目的测试发布项目更新依赖查看项目依赖关系树创建新的库项目文档生成 设置国内镜像 cd ~/.cargo # 创建config文件 vim config # 添加如下镜像源 [source.crates-io] registr ......
使用 cargo expand 查看被宏隐藏的代码
使用 cargo expand 查看被宏隐藏的代码 使用 VScode 安装扩展 Rust Macro Expand 需要安装以下软件: cargo-expand A cargo crate for easier handling of compiler commands Rust nightly ......
01 - 安装 Rust 和使用 Cargo
## 一、Rust 介绍 Rust 是一门系统编程语言,**专注于安全,尤其是并发安全**,支持函数式和命令式以及泛型等编程范式的多范式语言。Rust 在语法上和 C++ 类似,但是设计者想要在 保证性能的同时提供更好的内存安全。Rust 最初是由 Mozilla 研究院的 Graydon Hoar ......
vscode 运行Rust cargo test时显示log输出
使用以下tasks.json > 对于log库的输出(info,debug,warn...) 需要 在test方法上一行加 `#[test_log::test]` (来自 `test-log` https://crates.io/crates/test-log) ``` json { "versio ......
Hello Cargo
>创建于2023-03-30 09:51 > >本笔记主要来自于 [Rust 程序设计语言 中文版](https://rustwiki.org/zh-CN/book/title-page.html#rust-程序设计语言) [1.3],旨在记录个人学习过程中的重点和心得体会。在记录过程中,笔者会对文 ......
cargo rustc
RUSTC_BOOTSTRAP=1 如果需要在稳定版编译器上执行一些夜间发布功能,可以设置该环境变量。 $ cargo rustc -- -Zunpretty=expanded Compiling xxx v0.1.0 (F:\xxx) error: the option `Z` is only a ......