Skip to content

Commit 75f20fd

Browse files
committed
remve unneeded deps
1 parent e99c613 commit 75f20fd

File tree

10 files changed

+11
-45
lines changed

10 files changed

+11
-45
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ version = "3.0.0"
1414

1515
[workspace.dependencies]
1616
anyhow = { version = "1.0" }
17-
bytes = "1"
1817
chrono = { version = "0.4" }
1918
clap = { version = "4.5" }
2019
console = "0.16"
@@ -23,8 +22,6 @@ delay_timer = "0.11.6"
2322
duration-str = "0.17"
2423
futures = "0.3"
2524
futures-util = { version = "0.3", default-features = false }
26-
headers = "0.4"
27-
hyper = { version = "1" }
2825
if_chain = "1.0"
2926
indicatif = "0.18"
3027
lazy_static = "1.4"
@@ -39,8 +36,6 @@ tokio = { version = "1.0" }
3936
toml = { version = "0.9.8" }
4037
toml_edit = "0.23.7"
4138
tracing = "0.1.21"
42-
tracing-core = "0.1.32"
4339
tracing-subscriber = { version = "0.3" }
4440
walkdir = "2.5"
45-
salvo = "0.85.0"
46-
dunce = "1"
41+
salvo = "0.85.0"

client/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ tracing = { workspace = true }
3535
tracing-subscriber = { workspace = true, features = ["env-filter"] }
3636

3737
#config
38-
toml = { workspace = true }
3938
toml_edit = { workspace = true }
4039
serde = { workspace = true, features = ["derive"] }
4140
serde_json = { workspace = true }
@@ -48,5 +47,4 @@ md-5 = { workspace = true }
4847
# util
4948
anyhow = { workspace = true, features = ["backtrace"] }
5049
walkdir = { workspace = true }
51-
if_chain = { workspace = true }
52-
dunce = { workspace = true }
50+
if_chain = { workspace = true }

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ users to release SPA.
2323

2424
## Feature
2525

26-
- Built with Hyper and Salvo, fast and small!
26+
- Built with Salvo, fast and small!
2727
- Static web version control, you can regress or release a new version easily.
2828
- Docker support(compressed size: 32M).
2929
- Provide command line/npm package to deploy spa.

server/Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ path = "src/main.rs"
2020
[dependencies]
2121
entity = { path = "../entity" }
2222
# web
23-
hyper = { workspace = true }
24-
bytes = { workspace = true }
23+
#hyper = { workspace = true }
2524

2625
tokio = { workspace = true, features = ["macros", "rt-multi-thread", "io-std", "sync", "time", "tokio-macros"] }
2726

2827
# warp inner
2928
percent-encoding = { workspace = true }
30-
headers = { workspace = true }
29+
#headers = { workspace = true }
3130

3231
futures-util = { workspace = true }
3332

@@ -63,7 +62,5 @@ anyhow = { workspace = true, features = ["backtrace"] }
6362
walkdir = { workspace = true }
6463
# time
6564
chrono = { workspace = true, features = ["serde"] }
66-
#make if let more easy
67-
tracing-core = { workspace = true }
6865

6966
salvo = { workspace = true, features = ["serve-static", "size-limiter", "trailing-slash", "affix-state", "basic-auth"] }

server/src/config.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use anyhow::{Context, bail};
22
use duration_str::deserialize_duration;
3-
use headers::{HeaderValue, Origin};
3+
use salvo::http::HeaderValue;
44
use serde::{Deserialize, Deserializer};
55
use std::collections::HashSet;
66
use std::time::Duration;
@@ -134,7 +134,8 @@ impl<'de> Deserialize<'de> for OriginWrapper {
134134
let mut parts = data.splitn(2, "://");
135135
let scheme = parts.next().expect("missing scheme");
136136
let rest = parts.next().expect("missing scheme");
137-
let origin = Origin::try_from_parts(scheme, rest, None).expect("invalid Origin");
137+
let origin = salvo::http::headers::Origin::try_from_parts(scheme, rest, None)
138+
.expect("invalid Origin");
138139

139140
Ok(OriginWrapper(
140141
origin

server/src/domain_storage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,8 @@ mod test {
758758
use crate::config::Config;
759759
use crate::domain_storage::{DomainStorage, URI_REGEX_STR};
760760
use crate::file_cache::FileCache;
761-
use hyper::Uri;
762761
use regex::Regex;
762+
use salvo::http::uri::Uri;
763763
use std::env;
764764
use std::fs::OpenOptions;
765765
use std::io::Read;

server/src/file_cache.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use anyhow::anyhow;
22
use dashmap::DashMap;
3-
use hyper::body::Bytes;
43
use lazy_static::lazy_static;
54
use std::collections::HashMap;
65
use std::collections::HashSet;
@@ -196,17 +195,6 @@ impl FileCache {
196195
#[derive(Clone, Debug)]
197196
pub struct ArcPath(pub Arc<PathBuf>);
198197

199-
#[derive(Debug)]
200-
pub enum DataBlock {
201-
CacheBlock {
202-
bytes: Bytes,
203-
compressed: bool,
204-
path: ArcPath,
205-
},
206-
// for use warp
207-
FileBlock(ArcPath),
208-
}
209-
210198
pub struct CacheItem {
211199
pub data: PathBuf,
212200
pub version: u32,

server/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use spa_server::config::Config;
2-
use tracing_core::Level;
2+
use tracing::Level;
33
use tracing_subscriber::EnvFilter;
44

55
#[tokio::main]

server/src/service.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::config::{Config, extract_origin};
2-
use headers::HeaderValue;
3-
use hyper::StatusCode;
42
use salvo::Response;
3+
use salvo::http::{HeaderValue, StatusCode};
54
use std::collections::{HashMap, HashSet};
65
use std::sync::Arc;
76

0 commit comments

Comments
 (0)