戳人痛处

导航

[记]Rust上传库到crates.io失败的解决办法参考

1.SSL验证失败

fatal: unable to access 'https://github.com/rust-lang/crates.io-index/': OpenSSL SSL_read: Connection was reset, errno 10054

取消git的SSL验证

git config --global http.sslVerify "false"

2.由于网络原因的超时

fatal: unable to access 'https://github.com/rust-lang/crates.io-index/': Failed to connect to github.com port 443 after 21408 ms: Timed out

取消http传输方式

git config --global --unset http.proxy

 

---上传成功

PS D:\rrss\iii> cargo publish --registry crates-io    
    Updating crates.io index
   Packaging iii v0.1.2 (D:\rrss\iii)
   Verifying iii v0.1.2 (D:\rrss\iii)
warning: only one of `license` or `license-file` is necessary
`license` should be used if the package license can be expressed with a standard SPDX expression.
`license-file` should be used if the package uses a non-standard license.
See https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields for more information.
   Compiling iii v0.1.2 (D:\rrss\iii\target\package\iii-0.1.2)
warning: unused import: `Read`
 --> src\lib.rs:2:15
  |
2 | use std::io::{Read,Write, BufReader, BufRead};
  |               ^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: method `Loadfromiii` should have a snake case name
  --> src\lib.rs:18:12
   |
18 |     pub fn Loadfromiii(filepath:&'static str)->Self{
   |            ^^^^^^^^^^^ help: convert the identifier to snake case: `loadfromiii`
   |
   = note: `#[warn(non_snake_case)]` on by default

warning: unused `Result` that must be used
  --> src\lib.rs:52:13
   |
52 |             f.write(bufstr.as_bytes());
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this `Result` may be an `Err` variant, which should be handled
   = note: `#[warn(unused_must_use)]` on by default

warning: `iii` (lib) generated 3 warnings
    Finished dev [unoptimized + debuginfo] target(s) in 6.03s
    Packaged 10 files, 7.6KiB (3.3KiB compressed)
   Uploading iii v0.1.2 (D:\rrss\iii)
    Updating crates.io index
     Waiting on `iii` to propagate to crates.io index (ctrl-c to wait asynchronously)
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index
    Updating crates.io index

 

posted on 2023-02-01 09:40  戳人痛处  阅读(312)  评论(0编辑  收藏  举报