Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit e9355bd

Browse files
committed
chore(http): unused warnings on query structs
these query types were originally observing what kind of requests conformance tests do and what kind of requests go-ipfs supports, so keeping them as there might be some value. to be removed when upgrading conformance tests.
1 parent 8b7011f commit e9355bd

File tree

7 files changed

+17
-3
lines changed

7 files changed

+17
-3
lines changed

http/src/v0/dht.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct ResponsesMember {
3030
#[derive(Debug, Deserialize)]
3131
pub struct FindPeerQuery {
3232
arg: StringSerialized<PeerId>,
33-
// FIXME: doesn't seem to be used at the moment
33+
#[allow(unused)] // TODO: client sends
3434
verbose: Option<bool>,
3535
timeout: Option<StringSerialized<humantime::Duration>>,
3636
}
@@ -78,6 +78,7 @@ pub fn find_peer<T: IpfsTypes>(
7878
pub struct FindProvidersQuery {
7979
arg: StringSerialized<Cid>,
8080
// FIXME: in go-ipfs this returns a lot of logs
81+
#[allow(unused)]
8182
verbose: Option<bool>,
8283
#[serde(rename = "num-providers")]
8384
num_providers: Option<usize>,
@@ -132,6 +133,7 @@ pub fn find_providers<T: IpfsTypes>(
132133
pub struct ProvideQuery {
133134
arg: StringSerialized<Cid>,
134135
// FIXME: in go-ipfs this returns a lot of logs
136+
#[allow(unused)]
135137
verbose: Option<bool>,
136138
timeout: Option<StringSerialized<humantime::Duration>>,
137139
}
@@ -174,6 +176,7 @@ pub fn provide<T: IpfsTypes>(
174176
pub struct GetClosestPeersQuery {
175177
arg: StringSerialized<PeerId>,
176178
// FIXME: in go-ipfs this returns a lot of logs
179+
#[allow(unused)]
177180
verbose: Option<bool>,
178181
timeout: Option<StringSerialized<humantime::Duration>>,
179182
}

http/src/v0/id.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ async fn identity_query<T: IpfsTypes>(
6464
pub struct Query {
6565
// the peer id to query
6666
arg: Option<String>,
67-
// this does not seem to be reacted to by go-ipfs
67+
// FIXME: this does not seem to be reacted to by go-ipfs (need to recheck with more recent
68+
// version, remove if no longer interesting)
69+
#[allow(unused)]
6870
format: Option<String>,
6971
}
7072

http/src/v0/ipns.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ use warp::{query, Filter, Rejection, Reply};
77
pub struct ResolveQuery {
88
// the name to resolve
99
arg: StringSerialized<IpfsPath>,
10+
// FIXME: unsupported
11+
#[allow(unused)]
1012
#[serde(rename = "dht-record-count")]
1113
dht_record_count: Option<usize>,
14+
// FIXME: unsupported
15+
#[allow(unused)]
1216
#[serde(rename = "dht-timeout")]
1317
dht_timeout: Option<String>,
1418
}

http/src/v0/pin.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ struct ListRequest {
2626
arg: Vec<Cid>,
2727
filter: PinFilter,
2828
// FIXME: not sure if this is used
29+
#[allow(unused)]
2930
quiet: bool,
30-
// FIXME copypaste
31+
// FIXME: only the stream=true is supported
3132
stream: bool,
33+
#[allow(unused)] // sent by client
3234
timeout: Option<humantime::Duration>,
3335
}
3436

http/src/v0/root_files.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ mod add;
2121
pub struct AddArgs {
2222
// unknown meaning; ignoring it doesn't fail any tests
2323
#[serde(default, rename = "stream-channels")]
24+
#[allow(unused)] // sent by client
2425
stream_channels: bool,
2526
// progress reports totaling to the input file size
2627
#[serde(default)]

http/src/v0/swarm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ pub fn addrs<T: IpfsTypes>(
127127
}
128128

129129
#[derive(Debug, Deserialize)]
130+
#[allow(unused)] // for query sent by conformance tests
130131
struct AddrsLocalQuery {
131132
id: Option<bool>,
132133
}

http/src/v0/version.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
44
/// string. Defined in https://docs-beta.ipfs.io/reference/http/api/#api-v0-version. Included here
55
/// mostly as experimentation on how to do query parameters.
66
#[derive(Debug, Deserialize)]
7+
#[allow(unused)] // allowed that to define the version of the query the client sends in conformance tests
78
pub struct Query {
89
number: Option<bool>,
910
commit: Option<bool>,

0 commit comments

Comments
 (0)