Skip to content

Commit 966af5d

Browse files
committed
feat:fix lint
Signed-off-by: Chen Kai <[email protected]>
1 parent 028b889 commit 966af5d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

bin/archiver/src/api.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ use warp::http::{HeaderValue, StatusCode};
77
use warp::hyper::Body;
88
use warp::{Filter, Rejection, Reply};
99

10+
#[allow(dead_code)]
1011
pub struct Api {
1112
archiver: Arc<Archiver>,
1213
}
1314

15+
#[allow(dead_code)]
1416
#[derive(Serialize)]
1517
struct RearchiveResponse {
1618
success: bool,
@@ -30,12 +32,14 @@ impl Reply for RearchiveResponse {
3032
}
3133

3234
impl Api {
35+
#[allow(dead_code)]
3336
pub fn new(archiver: Archiver) -> Self {
3437
Self {
3538
archiver: Arc::new(archiver),
3639
}
3740
}
3841

42+
#[allow(dead_code)]
3943
pub fn routes(&self) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
4044
let archiver = self.archiver.clone();
4145
warp::path!("rearchive")
@@ -49,12 +53,14 @@ impl Api {
4953
.and_then(Self::healthz))
5054
}
5155

56+
#[allow(dead_code)]
5257
async fn healthz() -> Result<impl Reply, Rejection> {
5358
Ok(warp::reply::json(&serde_json::json!({
5459
"status": "ok"
5560
})))
5661
}
5762

63+
#[allow(dead_code)]
5864
async fn rearchive_range(
5965
query: RearchiveQuery,
6066
archiver: Arc<Archiver>,
@@ -112,7 +118,10 @@ impl Api {
112118

113119
#[derive(serde::Deserialize)]
114120
struct RearchiveQuery {
121+
#[allow(dead_code)]
115122
from: Option<u64>,
123+
124+
#[allow(dead_code)]
116125
to: Option<u64>,
117126
}
118127

@@ -180,9 +189,9 @@ mod tests {
180189
}
181190

182191
#[tokio::test]
183-
async fn test_rearchive_range() {
192+
async fn test_api_rearchive_range() {
184193
let (_, rx) = tokio::sync::watch::channel(false);
185-
let dir = &PathBuf::from("test_rearchive_range");
194+
let dir = &PathBuf::from("test_api_rearchive_range");
186195
let storage = FSStorage::new(dir.clone()).await.unwrap();
187196
tokio::fs::create_dir_all(dir).await.unwrap();
188197
let test_storage = Arc::new(Mutex::new(TestFSStorage::new(storage).await.unwrap()));

0 commit comments

Comments
 (0)