PrivateRookie / bian-rs

binance API client
Apache License 2.0
32 stars 12 forks source link

cargo添加依赖后无法fetch head,导致无法正确下载为依赖 #2

Closed veink-y closed 3 years ago

veink-y commented 3 years ago

RT

Caused by:
  process didn't exit successfully: `git fetch --force --update-head-ok https://github.com/PrivateRookie/bian-rs.git refs/heads/master:refs/remotes/origin/master HEAD:refs/remotes/origin/HEAD` (exit code: 128)
  --- stderr
  fatal: couldn't find remote ref refs/heads/master
PrivateRookie commented 3 years ago

Cargo.toml 文件是如何写的. 而且奇怪的是 bian-rs 没有 master 分支, 只有 main 分支, 是什么命令会尝试 fetch master 分支?

veink-y commented 3 years ago

cargo.toml是复制你的readme 运行的命令是 cargo run

然后我把你的代码完成拷贝了一份在我自己的仓库并提交就可以运行cargo run了,所以我觉得可能是仓库哪里没对

PrivateRookie commented 3 years ago

仓库地址是对的, 但cargo默认会找"master"分支, 而前一阵github创建的项目默认主分支都改成"main"了, 所以编译不成功, 而我在开发时为了方便修改, 用的文件路径, 所以没发现, 抱歉. 把依赖写成下面的样子是可以编译通过的

bian-rs = { git = "https://github.com/PrivateRookie/bian-rs.git", branch = "main" }

我已经修改的README文件

veink-y commented 3 years ago

多谢,学到了 toml的一个新写法