Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compile errors with rustc 1.74.0-nightly #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
678 changes: 341 additions & 337 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions packages/dht_crawler/src/dht/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,7 @@ mod tests {
Dht,
};
use failure::Error;
use tokio::{
spawn,
task::spawn_local,
};
use tokio::task::spawn_local;

#[tokio::test]
#[ignore]
Expand Down
2 changes: 1 addition & 1 deletion packages/dht_crawler/src/routing/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl Bucket {
.find(|node| node.state() == NodeState::Bad);

if let Some(bad_node) = bad_node_opt {
mem::replace(bad_node, node);
*bad_node = node;
}
}

Expand Down
5 changes: 4 additions & 1 deletion packages/dht_crawler/src/routing/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ mod tests {

#[test]
fn request_response_good() -> Result<(), Error> {
let epoch = NaiveDate::from_ymd(1970, 1, 1).and_hms_milli(0, 0, 1, 980);
let epoch = NaiveDate::from_ymd_opt(1970, 1, 1)
.unwrap()
.and_hms_milli_opt(0, 0, 1, 980)
.unwrap();

let node = Node {
id: NodeID::new(BigUint::from(10u8)),
Expand Down
3 changes: 2 additions & 1 deletion packages/dht_crawler/src/routing/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub enum FindNodeResult {
pub struct RoutingTable {
/// Node identifier of the node which the table is based around. There will
/// be more buckets closer to this identifier.
#[allow(unused)]
id: NodeID,

/// Ordered list of buckets covering the key space. The first bucket starts
Expand Down Expand Up @@ -61,7 +62,7 @@ impl RoutingTable {
bucket_idx
};

&mut self.buckets[bucket_to_add_to_idx].add_node(node);
self.buckets[bucket_to_add_to_idx].add_node(node);
}

/// Finds the node with `id`, or about the `k` nearest good nodes to the
Expand Down
4 changes: 2 additions & 2 deletions packages/krpc_encoding/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ authors = ["Martin Charles <martincharles07@gmail.com>"]
edition = "2018"

[dependencies]
serde = "1.0.152"
serde_derive = "1.0.152"
serde = "=1.0.152"
serde_derive = "=1.0.152"
serde_bencode = { git = "https://github.com/0xcaff/serde-bencode.git", rev = "0c1e6f4672c925c629b84fab2b66b24ec9f3458e" }
serde_bytes = "0.10.4"
thiserror = "1.0.38"
Expand Down
2 changes: 1 addition & 1 deletion packages/krpc_encoding/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(error_generic_member_access, provide_any)]
#![feature(error_generic_member_access)]

//! Library for serializing and de-serializing krpc messages defined in
//! [BEP-0005].
Expand Down
2 changes: 1 addition & 1 deletion packages/routing_table/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tokio_krpc = { path = "../tokio_krpc" }
krpc_encoding = { path = "../krpc_encoding" }
log = { version = "0.4.17", features = ["kv_unstable_serde"] }
tracing = "0.1.37"
serde = "1.0.152"
serde = "=1.0.152"
thiserror = "1.0.38"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion packages/routing_table/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// TODO: Docs

#![feature(generators, generator_trait)]
#![feature(error_generic_member_access, provide_any)]
#![feature(error_generic_member_access)]

mod full_b_tree;
mod generator;
Expand Down
5 changes: 4 additions & 1 deletion packages/routing_table/src/routing_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ impl RoutingTable {
visited.insert(address);

while let Some(next_node) = nodes.pop_front() {
let result = self.transport.find_node(next_node.clone(), self.id.clone()).await;
let result = self
.transport
.find_node(next_node.clone(), self.id.clone())
.await;

match result {
Err(err) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/routing_table/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use futures_util::{
future,
TryStreamExt,
StreamExt,
TryStreamExt,
};
use krpc_encoding::NodeID;
use routing_table::RoutingTable;
Expand Down
2 changes: 1 addition & 1 deletion packages/tokio_krpc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(error_generic_member_access, provide_any)]
#![feature(error_generic_member_access)]

//! KRPC protocol built on top of `tokio`.
//!
Expand Down