Skip to content

Commit 5cefcc4

Browse files
committed
fix: 移除无用的 async 标记
1 parent ff9d3e5 commit 5cefcc4

File tree

17 files changed

+1277
-85
lines changed

17 files changed

+1277
-85
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
[workspace]
22
resolver = "3"
3-
members = ["crates/fast-steal", "crates/fast-pull", "crates/fast-down"]
3+
members = ["crates/fast-down", "crates/fast-pull", "crates/fast-steal"]
44

55
[workspace.package]
6+
authors = ["share121 <[email protected]>", "Cyan Changes <[email protected]>"]
67
edition = "2024"
78
homepage = "https://github.com/fast-down/core"
89
repository = "https://github.com/fast-down/core"
910
license = "MIT"
10-
authors = ["share121 <[email protected]>", "Cyan Changes <[email protected]>"]
1111

1212
[workspace.dependencies]
13-
fast-pull = { version = "3.5.0", path = "crates/fast-pull" }
14-
fast-steal = { version = "6.2.0", path = "crates/fast-steal" }
15-
kanal = "0.1.1"
1613
bytes = { version = "1.10.1", default-features = false }
14+
fast-pull = { path = "crates/fast-pull", version = "3.5.0" }
15+
fast-steal = { path = "crates/fast-steal", version = "6.2.0" }
1716
futures = { version = "0.3.31", default-features = false }
17+
kanal = "0.1.1"
18+
spin = { version = "0.10.0", default-features = false, features = [
19+
"spin_mutex",
20+
] }
1821
thiserror = "2.0.12"
1922
url = "2.5.4"
20-
spin = { version = "0.10.0", features = [
21-
"spin_mutex",
22-
], default-features = false }

crates/fast-down/Cargo.toml

Lines changed: 45 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,60 @@
11
[package]
22
name = "fast-down"
3+
version = "3.5.1"
4+
authors.workspace = true
5+
edition.workspace = true
36
description = "Download everything fast"
4-
version = "3.5.0"
5-
readme = "README.md"
67
documentation = "https://docs.rs/fast-down"
7-
keywords = ["download", "fast", "parallel", "concurrency"]
8-
categories = ["concurrency", "asynchronous", "network-programming", "no-std"]
9-
edition.workspace = true
10-
authors.workspace = true
11-
license.workspace = true
12-
repository.workspace = true
8+
readme = "README.md"
139
homepage.workspace = true
10+
repository.workspace = true
11+
license.workspace = true
12+
keywords = ["concurrency", "download", "fast", "parallel"]
13+
categories = ["asynchronous", "concurrency", "network-programming", "no-std"]
1414

1515
[dependencies]
16+
aria2-gid = { version = "0.1.0", optional = true }
17+
bytes.workspace = true
18+
content_disposition = { version = "0.4.0", optional = true }
1619
fast-pull.workspace = true
1720
futures.workspace = true
18-
url.workspace = true
19-
content_disposition = { version = "0.4.0", optional = true }
20-
urlencoding = { version = "2.1.3", optional = true }
21-
bytes.workspace = true
22-
reqwest = { version = "0.12.22", default-features = false, optional = true }
23-
thiserror.workspace = true
24-
tokio = { version = "1.47.1", default-features = false }
2521
httpdate = { version = "1.0.3", optional = true }
26-
spin = { workspace = true, optional = true }
22+
inherit-config = { version = "0.1.1", optional = true }
23+
inherit-config-derive = { version = "0.1.1", optional = true }
24+
kanal = { workspace = true, optional = true }
25+
reqwest = { version = "0.12.22", default-features = false, features = [
26+
"brotli",
27+
"deflate",
28+
"gzip",
29+
"http2",
30+
"rustls-tls",
31+
"system-proxy",
32+
"zstd"
33+
], optional = true }
2734
sanitize-filename = { version = "0.6.0", optional = true }
28-
29-
[features]
30-
default = ["reqwest", "sanitize-filename"]
31-
http = ["dep:content_disposition", "dep:urlencoding", "dep:spin"]
32-
reqwest = ["http", "dep:reqwest", "dep:httpdate"]
33-
sanitize-filename = ["dep:sanitize-filename"]
35+
spin = { workspace = true, optional = true }
36+
thiserror.workspace = true
37+
tokio = { version = "1.47.1", default-features = false }
38+
url.workspace = true
39+
urlencoding = { version = "2.1.3", optional = true }
3440

3541
[dev-dependencies]
36-
tokio = { version = "1.47.1", features = [
37-
"rt",
42+
mockito = "1.7.0"
43+
tokio = { version = "1.47.1", default-features = false, features = [
3844
"io-util",
45+
"rt",
3946
"test-util",
40-
], default-features = false }
41-
mockito = "1.7.0"
47+
] }
48+
49+
[features]
50+
default = ["reqwest", "sanitize-filename"]
51+
downloader = [
52+
"dep:aria2-gid",
53+
"dep:inherit-config",
54+
"dep:inherit-config-derive",
55+
"dep:kanal",
56+
"reqwest"
57+
]
58+
http = ["dep:content_disposition", "dep:spin", "dep:urlencoding"]
59+
reqwest = ["dep:httpdate", "dep:reqwest", "http"]
60+
sanitize-filename = ["dep:sanitize-filename"]
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
use inherit_config_derive::Config;
2+
use reqwest::header::HeaderMap;
3+
use std::{
4+
num::{NonZero, NonZeroU64, NonZeroUsize},
5+
path::Path,
6+
sync::Arc,
7+
time::Duration,
8+
};
9+
10+
#[derive(Debug, Clone, Config)]
11+
pub struct DownloadConfig {
12+
#[config(default = Some(NonZero::new(32).unwrap()))]
13+
pub threads: Option<NonZeroUsize>,
14+
15+
#[config(default = Some(Arc::from("")))]
16+
pub proxy: Option<Arc<str>>,
17+
18+
#[config(default = Some(Arc::new(HeaderMap::new())))]
19+
pub headers: Option<Arc<HeaderMap>>,
20+
21+
#[config(default = Some(false))]
22+
pub accept_invalid_certs: Option<bool>,
23+
24+
#[config(default = Some(false))]
25+
pub accept_invalid_hostnames: Option<bool>,
26+
27+
#[config(default = Some(false))]
28+
pub multiplexing: Option<bool>,
29+
30+
#[config(default = Some(Path::new(".").into()))]
31+
pub save_dir: Option<Arc<Path>>,
32+
33+
#[config(default = Some(1024))]
34+
pub write_queue_cap: Option<usize>,
35+
36+
#[config(default = Some(8 * 1024 * 1024))]
37+
pub write_buffer_size: Option<usize>,
38+
39+
#[config(default = Some(Duration::from_millis(500)))]
40+
pub retry_gap: Option<Duration>,
41+
42+
#[config(default = Some(NonZero::new(1024 * 1024).unwrap()))]
43+
pub min_chunk_size: Option<NonZeroU64>,
44+
}

0 commit comments

Comments
 (0)