Skip to content

Commit a13b864

Browse files
committed
fix codes
1 parent 5987fdf commit a13b864

File tree

5 files changed

+157
-102
lines changed

5 files changed

+157
-102
lines changed

Cargo.lock

Lines changed: 21 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "qiniu-uploader"
3-
version = "0.1.6"
3+
version = "0.1.7"
44
edition = "2021"
55
description = "Qiniu upload lib with progress bar"
66
authors = ["linghaihui <[email protected]>"]
@@ -13,22 +13,20 @@ exclude = ["snapshot.png", ".github"]
1313
anyhow = "1.0.86"
1414
base64 = "0.22.1"
1515
chrono = "0.4.38"
16-
futures-util = {version = "0.3.30", optional = true}
1716
hmac-sha1 = "0.2.2"
18-
indicatif = { version = "0.17.8", optional = true }
1917
mime = "0.3.17"
2018
reqwest = {version = "0.12.5", default-features = false, features = ["rustls-tls", "multipart", "stream", "json"] }
2119
serde = { version = "1.0.204", features = ["derive"] }
2220
serde_json = "1.0.122"
2321
tokio = { version = "1.39.2", default-features = false}
24-
tokio-util = "0.7.11"
22+
tokio-util = {version = "0.7.11", optional = true}
23+
futures-util = {version = "0.3.30", optional = true}
24+
indicatif = { version = "0.17.8", optional = true }
2525

2626
[dev-dependencies]
2727
tokio = { version = "1.39.2", features=["full"] }
2828
anyhow = "1.0.86"
2929

3030
[features]
3131
default = ["progress-bar"]
32-
indicatif = ["dep:indicatif"]
33-
futures-util = ["dep:futures-util"]
34-
progress-bar = ["indicatif", "futures-util"]
32+
progress-bar = ["dep:indicatif", "dep:futures-util", "dep:tokio-util"]

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[![Crates.io](https://img.shields.io/crates/v/qiniu-uploader?style=flat-square)](https://crates.io/crates/qiniu-uploader)
2+
[![qiniu-uploader](https://github.com/bujnlc8/qiniu-uploader/actions/workflows/qiniu-uploader.yml/badge.svg)](https://github.com/bujnlc8/qiniu-uploader/actions/workflows/qiniu-uploader.yml)
3+
14
# 七牛文件上传
25

36
封装了七牛[直传文件](https://developer.qiniu.com/kodo/1312/upload)[分片上传 v2 版](https://developer.qiniu.com/kodo/6364/multipartupload-interface),支持显示上传进度条,由[indicatif](https://crates.io/crates/indicatif)提供支持.

examples/upload.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,9 @@ async fn main() -> Result<(), anyhow::Error> {
3737
None,
3838
)
3939
.await?;
40+
let file = fs::File::open("./Cargo.lock").await?;
41+
qiniu
42+
.upload_file_no_progress_bar("test/Cargo.lock.1", file, mime::APPLICATION_OCTET_STREAM)
43+
.await?;
4044
Ok(())
4145
}

0 commit comments

Comments
 (0)