Skip to content

Commit

Permalink
Switch to edition 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Nov 4, 2021
1 parent f39d878 commit 9f5cb11
Show file tree
Hide file tree
Showing 17 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion bee-api/bee-rest-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bee-rest-api"
version = "0.1.0-alpha"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = ""
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use bee_tangle::Tangle;

use warp::{Filter, Rejection, Reply};

use std::{iter::FromIterator, net::IpAddr};
use std::net::IpAddr;

fn path() -> impl Filter<Extract = (MessageId,), Error = warp::Rejection> + Clone {
super::path()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use bee_storage::access::AsIterator;

use warp::{Filter, Rejection, Reply};

use std::{convert::TryFrom, net::IpAddr};
use std::net::IpAddr;

fn path() -> impl Filter<Extract = (), Error = Rejection> + Clone {
super::path().and(warp::path("receipts")).and(warp::path::end())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use bee_storage::access::Fetch;

use warp::{Filter, Rejection, Reply};

use std::{convert::TryFrom, net::IpAddr};
use std::net::IpAddr;

fn path() -> impl Filter<Extract = (MilestoneIndex,), Error = Rejection> + Clone {
super::path()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use serde_json::Value as JsonValue;
use tokio::sync::mpsc;
use warp::{http::StatusCode, reject, Filter, Rejection, Reply};

use std::{convert::TryFrom, net::IpAddr};
use std::net::IpAddr;

fn path() -> impl Filter<Extract = (), Error = Rejection> + Clone {
super::path().and(warp::path("messages")).and(warp::path::end())
Expand Down
2 changes: 0 additions & 2 deletions bee-api/bee-rest-api/src/types/dtos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ use bee_protocol::types::peer::Peer;
use serde::{Deserialize, Serialize, Serializer};
use serde_json::Value;

use std::convert::{TryFrom, TryInto};

/// The message object that nodes gossip around in the network.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct MessageDto {
Expand Down
2 changes: 1 addition & 1 deletion bee-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bee-node"
version = "0.2.1"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = ""
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
Expand Down
2 changes: 1 addition & 1 deletion bee-node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crypto::hashes::{blake2b::Blake2b256, Digest};
use serde::Deserialize;
use thiserror::Error;

use std::{convert::TryInto, fs, path::Path};
use std::{fs, path::Path};

const DEFAULT_ALIAS: &str = "bee";
const DEFAULT_BECH32_HRP: &str = "iota";
Expand Down
2 changes: 0 additions & 2 deletions bee-node/src/plugins/dashboard/websocket/commands.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0

use std::convert::TryFrom;

#[repr(u8)]
#[derive(Debug)]
pub(crate) enum WsCommand {
Expand Down
1 change: 0 additions & 1 deletion bee-node/src/plugins/dashboard/websocket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ use warp::ws::{Message, WebSocket};

use std::{
collections::{HashMap, HashSet},
convert::TryInto,
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
Expand Down
2 changes: 0 additions & 2 deletions bee-node/src/plugins/dashboard/websocket/topics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

use serde_repr::Serialize_repr;

use std::convert::TryFrom;

#[repr(u8)]
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize_repr)]
pub(crate) enum WsTopic {
Expand Down
2 changes: 1 addition & 1 deletion bee-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bee-protocol"
version = "0.1.0-alpha"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = ""
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
Expand Down
1 change: 0 additions & 1 deletion bee-protocol/src/workers/message/hash_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ impl Hasher for CustomHasher {
CustomHasher::finish(self)
}
fn write(&mut self, bytes: &[u8]) {
use std::convert::TryInto;
let (int_bytes, _rest) = bytes.split_at(std::mem::size_of::<u64>());
let i = u64::from_ne_bytes(int_bytes.try_into().unwrap());
CustomHasher::write(self, i);
Expand Down
2 changes: 0 additions & 2 deletions bee-protocol/src/workers/packets/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

//! Header of the type-length-value encoding.

use std::convert::TryInto;

const HEADER_TYPE_SIZE: usize = 1;
const HEADER_LENGTH_SIZE: usize = 2;
pub(crate) const HEADER_SIZE: usize = HEADER_TYPE_SIZE + HEADER_LENGTH_SIZE;
Expand Down
2 changes: 1 addition & 1 deletion bee-protocol/src/workers/packets/heartbeat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::workers::packets::Packet;

use std::{convert::TryInto, ops::Range};
use std::ops::Range;

const SOLID_MILESTONE_INDEX_SIZE: usize = 4;
const PRUNED_INDEX_SIZE: usize = 4;
Expand Down
2 changes: 1 addition & 1 deletion bee-protocol/src/workers/packets/milestone_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

use crate::workers::packets::Packet;

use std::{convert::TryInto, ops::Range};
use std::ops::Range;

const INDEX_SIZE: usize = 4;
const CONSTANT_SIZE: usize = INDEX_SIZE;
Expand Down
2 changes: 0 additions & 2 deletions bee-protocol/src/workers/packets/tlv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ mod tests {

use rand::Rng;

use std::convert::TryInto;

fn invalid_advertised_type<P: Packet>() {
match tlv_from_bytes::<P>(
&HeaderPacket {
Expand Down

0 comments on commit 9f5cb11

Please sign in to comment.