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

build: fix wrong repo urls, clippies #480

Merged
merged 6 commits into from
Jan 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ jobs:
echo "::set-output name=dir::$(npm config get cache)"
echo "::set-output name=ver::$(npm -v)"

- name: "Conformance tests: setup nodejs 14"
uses: actions/setup-node@v2
with:
node-version: '14'

- name: "Conformance tests: cache"
id: conformance-cache
if: matrix.platform.cross == false
Expand Down
22 changes: 11 additions & 11 deletions conformance/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions conformance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"dependencies": {
"aegir": "^21.3.0",
"interface-ipfs-core": "0.139.0",
"ipfsd-ctl": "github:ipfs-rust/js-ipfsd-ctl#add_rust_ipfs_http",
"ipfsd-ctl": "github:rs-ipfs/js-ipfsd-ctl#add_rust_ipfs_http",
"mocha": "^7.1.0",
"ipfs-http-client": "46.0.0",
"why-is-node-running": "2.2.0"
},
"devDependencies": {
"rust-ipfs-dep": "github:ipfs-rust/npm-rust-ipfs-dep#master",
"rust-ipfs-dep": "github:rs-ipfs/npm-rust-ipfs-dep#master",
"ipfs": "0.49.0"
}
}
5 changes: 4 additions & 1 deletion http/src/v0/dht.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct ResponsesMember {
#[derive(Debug, Deserialize)]
pub struct FindPeerQuery {
arg: StringSerialized<PeerId>,
// FIXME: doesn't seem to be used at the moment
#[allow(unused)] // TODO: client sends
verbose: Option<bool>,
timeout: Option<StringSerialized<humantime::Duration>>,
}
Expand Down Expand Up @@ -78,6 +78,7 @@ pub fn find_peer<T: IpfsTypes>(
pub struct FindProvidersQuery {
arg: StringSerialized<Cid>,
// FIXME: in go-ipfs this returns a lot of logs
#[allow(unused)]
verbose: Option<bool>,
#[serde(rename = "num-providers")]
num_providers: Option<usize>,
Expand Down Expand Up @@ -132,6 +133,7 @@ pub fn find_providers<T: IpfsTypes>(
pub struct ProvideQuery {
arg: StringSerialized<Cid>,
// FIXME: in go-ipfs this returns a lot of logs
#[allow(unused)]
verbose: Option<bool>,
timeout: Option<StringSerialized<humantime::Duration>>,
}
Expand Down Expand Up @@ -174,6 +176,7 @@ pub fn provide<T: IpfsTypes>(
pub struct GetClosestPeersQuery {
arg: StringSerialized<PeerId>,
// FIXME: in go-ipfs this returns a lot of logs
#[allow(unused)]
verbose: Option<bool>,
timeout: Option<StringSerialized<humantime::Duration>>,
}
Expand Down
4 changes: 3 additions & 1 deletion http/src/v0/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ async fn identity_query<T: IpfsTypes>(
pub struct Query {
// the peer id to query
arg: Option<String>,
// this does not seem to be reacted to by go-ipfs
// FIXME: this does not seem to be reacted to by go-ipfs (need to recheck with more recent
// version, remove if no longer interesting)
#[allow(unused)]
format: Option<String>,
}

Expand Down
4 changes: 4 additions & 0 deletions http/src/v0/ipns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ use warp::{query, Filter, Rejection, Reply};
pub struct ResolveQuery {
// the name to resolve
arg: StringSerialized<IpfsPath>,
// FIXME: unsupported
#[allow(unused)]
#[serde(rename = "dht-record-count")]
dht_record_count: Option<usize>,
// FIXME: unsupported
#[allow(unused)]
#[serde(rename = "dht-timeout")]
dht_timeout: Option<String>,
}
Expand Down
4 changes: 3 additions & 1 deletion http/src/v0/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ struct ListRequest {
arg: Vec<Cid>,
filter: PinFilter,
// FIXME: not sure if this is used
#[allow(unused)]
quiet: bool,
// FIXME copypaste
// FIXME: only the stream=true is supported
stream: bool,
#[allow(unused)] // sent by client
timeout: Option<humantime::Duration>,
}

Expand Down
1 change: 1 addition & 0 deletions http/src/v0/root_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ mod add;
pub struct AddArgs {
// unknown meaning; ignoring it doesn't fail any tests
#[serde(default, rename = "stream-channels")]
#[allow(unused)] // sent by client
stream_channels: bool,
// progress reports totaling to the input file size
#[serde(default)]
Expand Down
1 change: 1 addition & 0 deletions http/src/v0/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ pub fn addrs<T: IpfsTypes>(
}

#[derive(Debug, Deserialize)]
#[allow(unused)] // for query sent by conformance tests
struct AddrsLocalQuery {
id: Option<bool>,
}
Expand Down
1 change: 1 addition & 0 deletions http/src/v0/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use serde::{Deserialize, Serialize};
/// string. Defined in https://docs-beta.ipfs.io/reference/http/api/#api-v0-version. Included here
/// mostly as experimentation on how to do query parameters.
#[derive(Debug, Deserialize)]
#[allow(unused)] // allowed that to define the version of the query the client sends in conformance tests
pub struct Query {
number: Option<bool>,
commit: Option<bool>,
Expand Down
2 changes: 1 addition & 1 deletion src/ipld/dag_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ where
Ipld::String(string) => ser.serialize_str(string),
Ipld::Bytes(bytes) => ser.serialize_bytes(bytes),
Ipld::List(list) => {
let wrapped = list.iter().map(|ipld| Wrapper(ipld));
let wrapped = list.iter().map(Wrapper);
ser.collect_seq(wrapped)
}
Ipld::Map(map) => {
Expand Down
4 changes: 2 additions & 2 deletions src/ipns/dnslink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub async fn resolve(domain: &str) -> Result<IpfsPath, Error> {
// previous implementation searched $domain and _dnslink.$domain concurrently. not sure did
// `domain` assume fqdn names or not, but local suffices were not being searched on windows at
// least. they are probably waste of time most of the time.
for domain in searched.into_iter() {
for domain in searched {
let res = match resolver.txt_lookup(&*domain).await {
Ok(res) => res,
Err(e) => {
Expand All @@ -55,7 +55,7 @@ pub async fn resolve(domain: &str) -> Result<IpfsPath, Error> {
.map(|suffix| {
std::str::from_utf8(suffix)
.map_err(Error::from)
.and_then(|s| IpfsPath::from_str(s))
.and_then(IpfsPath::from_str)
});

if let Some(Ok(x)) = paths.next() {
Expand Down
8 changes: 5 additions & 3 deletions src/ipns/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ mod dnslink;
/// IPNS facade around [`Ipns`].
#[derive(Clone, Debug)]
pub struct Ipns<Types: RepoTypes> {
ipfs: Ipfs<Types>,
// FIXME(unused): scaffolding while ipns functionality as a whole suggests we should have dht
// queries etc. here (currently unimplemented).
_ipfs: Ipfs<Types>,
}

impl<Types: RepoTypes> Ipns<Types> {
pub fn new(ipfs: Ipfs<Types>) -> Self {
Ipns { ipfs }
pub fn new(_ipfs: Ipfs<Types>) -> Self {
Ipns { _ipfs }
}

/// Resolves a ipns path to an ipld path.
Expand Down
6 changes: 1 addition & 5 deletions src/repo/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::error::Error;
use async_trait::async_trait;
use std::fs::File;
use std::path::PathBuf;
use std::sync::{atomic::AtomicU64, Arc};
use std::sync::Arc;
use tokio::sync::Semaphore;

use super::{BlockRm, BlockRmError, Column, DataStore, Lock, LockError, RepoCid};
Expand Down Expand Up @@ -41,9 +41,6 @@ pub struct FsDataStore {
/// collection implementation, it might be needed to hold this permit for the duration of
/// garbage collection, or something similar.
lock: Arc<Semaphore>,

/// Not really needed
written_bytes: AtomicU64,
}

/// The column operations are all unimplemented pending at least downscoping of the
Expand All @@ -55,7 +52,6 @@ impl DataStore for FsDataStore {
FsDataStore {
path: root,
lock: Arc::new(Semaphore::new(1)),
written_bytes: Default::default(),
}
}

Expand Down
2 changes: 2 additions & 0 deletions unixfs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Next

* Document panic introduced in walker ergonomics [#435]
* `#[non_exhaustive]` on `unixfs::InvalidCidInLink` error [#480]

[#435]: https://github.com/rs-ipfs/rust-ipfs/pull/435
[#480]: https://github.com/rs-ipfs/rust-ipfs/pull/480

# 0.2.0

Expand Down
5 changes: 4 additions & 1 deletion unixfs/src/dir/builder/custom_pb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ impl<'a> CustomFlatUnixFs<'a> {
fn mapped(&self) -> impl Iterator<Item = NamedLeafAsPBLink<'_>> + '_ {
self.links
.iter()
.map(|triple| triple.as_ref().map(|l| NamedLeafAsPBLink(l)).unwrap())
// FIXME: this unwrap here seems dangerious; it seems to follow from
// `crate::dir::builder::iter::Leaves` assumption that all of these options have
// already been filled at the previous stages of post-order visit
.map(|triple| triple.as_ref().map(NamedLeafAsPBLink).unwrap())
}
}

Expand Down
4 changes: 1 addition & 3 deletions unixfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub(crate) mod test_support;

/// A link could not be transformed into a Cid.
#[derive(Debug)]
#[non_exhaustive]
pub struct InvalidCidInLink {
/// The index of this link, from zero
pub nth: usize,
Expand All @@ -47,8 +48,6 @@ pub struct InvalidCidInLink {
pub name: Cow<'static, str>,
/// Error from the attempted conversion
pub source: cid::Error,
/// This is to deny creating these outside of the crate
hidden: (),
}

impl<'a> From<(usize, pb::PBLink<'a>, cid::Error)> for InvalidCidInLink {
Expand All @@ -70,7 +69,6 @@ impl<'a> From<(usize, pb::PBLink<'a>, cid::Error)> for InvalidCidInLink {
hash,
name,
source,
hidden: (),
}
}
}
Expand Down