我们使用 dotenv 读取 OS 环境变量或者项目中的 .env 文件
.env
rust 安装 dotenv 点击前往 官方安装教程
# 安装二进制文件和库 cargo install -f dotenv # 只安装库作为项目的依赖 cargo install cargo-edit cargo add dotenv
添加依赖
[dependencies] dotenv = "0.15.0" # 截至 2022/6/13
posted on 2022-06-13 12:23 Slime04 阅读(297) 评论(0) 收藏 举报