Skip to content

Commit

Permalink
Switch to edition 2021 (#788)
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault-martinez committed Nov 4, 2021
1 parent 4f5a604 commit e026b4c
Show file tree
Hide file tree
Showing 76 changed files with 65 additions and 125 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.3"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = "The default REST API implementation for the IOTA Bee node software."
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
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 @@ -31,8 +31,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-common/bee-common-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bee-common-derive"
version = "0.1.1-alpha"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = "Derive macros for the bee-common crate"
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
Expand Down
2 changes: 1 addition & 1 deletion bee-common/bee-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bee-common"
version = "0.5.0"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = "Common utilities used across the bee framework"
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
Expand Down
2 changes: 1 addition & 1 deletion bee-crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bee-crypto"
version = "0.2.1-alpha"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = "Cryptographic primitives of the IOTA protocol"
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
Expand Down
1 change: 0 additions & 1 deletion bee-crypto/src/ternary/bigint/i384/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ use byteorder::{self, ByteOrder};

use std::{
cmp::Ordering,
convert::{TryFrom, TryInto},
fmt,
marker::PhantomData,
ops::{Deref, DerefMut},
Expand Down
5 changes: 1 addition & 4 deletions bee-crypto/src/ternary/bigint/t242/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ use crate::ternary::bigint::{

use bee_ternary::{Btrit, ShiftTernary, T1B1Buf, Trit, TritBuf, Utrit};

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

def_and_impl_ternary!(T242, 242);

Expand Down
2 changes: 0 additions & 2 deletions bee-crypto/src/ternary/bigint/u384/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ use bee_ternary::Utrit;

use lazy_static::lazy_static;

use std::convert::TryFrom;

lazy_static! {
/// U384 big-endian `u32` represented half of maximum value.
pub static ref BE_U32_HALF_MAX: U384<BigEndian, U32Repr> = (*LE_U32_HALF_MAX).into();
Expand Down
1 change: 0 additions & 1 deletion bee-crypto/src/ternary/bigint/u384/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ use byteorder::{self, ByteOrder};

use std::{
cmp::Ordering,
convert::TryFrom,
fmt,
marker::PhantomData,
ops::{Deref, DerefMut},
Expand Down
1 change: 0 additions & 1 deletion bee-crypto/src/ternary/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use bee_ternary::{raw::RawEncoding, Btrit, Trits, T1B1};

use std::{
cmp::PartialEq,
convert::TryFrom,
fmt, hash,
ops::{Deref, DerefMut},
};
Expand Down
2 changes: 0 additions & 2 deletions bee-crypto/tests/binary_to_ternary_roundtrip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use bee_crypto::ternary::bigint::{binary_representation::U32Repr, endianness::LittleEndian, I384, T243, U384};
use bee_ternary::{Btrit, Utrit};

use std::convert::TryInto;

macro_rules! binary_to_ternary_roundtrip {
( ( $($binary_type:tt)* ), ( $($ternary_type:tt)* ), $testname:ident, $val_fn:ident ) => {
#[test]
Expand Down
2 changes: 0 additions & 2 deletions bee-crypto/tests/ternary_to_binary_roundtrip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use bee_crypto::ternary::bigint::{binary_representation::U32Repr, endianness::LittleEndian, I384, T242, T243, U384};
use bee_ternary::{Btrit, Utrit};

use std::convert::TryInto;

#[test]
fn t243_max_exceeds_u384_range() {
let t243_max = T243::<Btrit>::max();
Expand Down
2 changes: 0 additions & 2 deletions bee-crypto/tests/trytes_to_bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use bee_crypto::ternary::bigint::{binary_representation::U8Repr, endianness::BigEndian, I384, T243};
use bee_ternary::{T1B1Buf, TritBuf, TryteBuf};

use std::convert::TryFrom;

#[test]
fn trytes_to_i384_be_u8_1() {
const INPUT_TRYTES: &str = "EMIDYNHBWMBCXVDEFOFWINXTERALUKYYPPHKP9JJFGJEIUY9MUDVNFZHMMWZUYUSWAIOWEVTHNWMHANBH";
Expand Down
2 changes: 1 addition & 1 deletion bee-ledger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bee-ledger"
version = "0.5.0"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = "All types and features required to compute and maintain the ledger state"
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
Expand Down
2 changes: 1 addition & 1 deletion bee-ledger/src/workers/consensus/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use log::{debug, error, info, warn};
use tokio::sync::mpsc;
use tokio_stream::wrappers::UnboundedReceiverStream;

use std::{any::TypeId, convert::TryInto};
use std::any::TypeId;

pub(crate) const EXTRA_SNAPSHOT_DEPTH: u32 = 5;
pub(crate) const EXTRA_PRUNING_DEPTH: u32 = 5;
Expand Down
2 changes: 1 addition & 1 deletion bee-message/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bee-message"
version = "0.1.5"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = "Implementation of the IOTA protocol message layouts"
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
Expand Down
2 changes: 1 addition & 1 deletion bee-message/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "bee-message-fuzz"
version = "0.0.0"
authors = [ "Automatically generated" ]
publish = false
edition = "2018"
edition = "2021"

[package.metadata]
cargo-fuzz = true
Expand Down
2 changes: 1 addition & 1 deletion bee-message/src/address/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crypto::{
signatures::ed25519::{PublicKey, Signature},
};

use core::{convert::TryInto, str::FromStr};
use core::str::FromStr;

/// The number of bytes in an Ed25519 address.
/// See <https://en.wikipedia.org/wiki/EdDSA#Ed25519> for more information.
Expand Down
1 change: 0 additions & 1 deletion bee-message/src/address/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use bee_common::packable::{Packable, Read, Write};
use bech32::{self, FromBase32, ToBase32, Variant};

use alloc::{str::FromStr, string::String};
use core::convert::TryFrom;

/// A generic address supporting different address kinds.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
Expand Down
2 changes: 1 addition & 1 deletion bee-message/src/message_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::Error;

use bee_common::packable::{Packable, Read, Write};

use core::{convert::TryInto, str::FromStr};
use core::str::FromStr;

/// The length of a message identifier.
pub const MESSAGE_ID_LENGTH: usize = 32;
Expand Down
5 changes: 1 addition & 4 deletions bee-message/src/output/output_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ use crate::{

use bee_common::packable::{Packable, Read, Write};

use core::{
convert::{From, TryFrom, TryInto},
str::FromStr,
};
use core::str::FromStr;

/// The length of an `OutputId`.
pub const OUTPUT_ID_LENGTH: usize = TRANSACTION_ID_LENGTH + std::mem::size_of::<u16>();
Expand Down
2 changes: 1 addition & 1 deletion bee-message/src/payload/milestone/milestone_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::Error;

use bee_common::packable::{Packable, Read, Write};

use core::{convert::TryInto, str::FromStr};
use core::str::FromStr;

/// The length of a milestone identifier.
pub const MILESTONE_ID_LENGTH: usize = 32;
Expand Down
2 changes: 1 addition & 1 deletion bee-message/src/payload/milestone/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crypto::{
};

use alloc::{boxed::Box, vec::Vec};
use core::{convert::TryInto, ops::RangeInclusive};
use core::ops::RangeInclusive;

/// Range of allowed milestones signatures key numbers.
pub const MILESTONE_SIGNATURE_COUNT_RANGE: RangeInclusive<usize> = 1..=255;
Expand Down
2 changes: 0 additions & 2 deletions bee-message/src/payload/receipt/tail_transaction_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ use bee_ternary::{T5B1Buf, TritBuf, Trits, T5B1};

use bytemuck::cast_slice;

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

/// The length of a tail transaction hash.
pub const TAIL_TRANSACTION_HASH_LEN: usize = 49;

Expand Down
2 changes: 1 addition & 1 deletion bee-message/src/payload/transaction/transaction_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::Error;

use bee_common::packable::{Packable, Read, Write};

use core::{convert::TryInto, str::FromStr};
use core::str::FromStr;

/// The length of a transaction identifier.
pub const TRANSACTION_ID_LENGTH: usize = 32;
Expand Down
2 changes: 0 additions & 2 deletions bee-message/src/unlock/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use crate::{constants::INPUT_OUTPUT_INDEX_RANGE, Error};

use bee_common::packable::{Packable, Read, Write};

use core::convert::TryFrom;

/// An [`UnlockBlock`](crate::unlock::UnlockBlock) that refers to another unlock block.
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
Expand Down
2 changes: 0 additions & 2 deletions bee-message/tests/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use bee_common::packable::Packable;
use bee_message::prelude::*;

use core::convert::TryInto;

const ED25519_ADDRESS: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649";
const ED25519_ADDRESS_BAD: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c64x";

Expand Down
2 changes: 1 addition & 1 deletion bee-message/tests/ed25519_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use bee_common::packable::Packable;
use bee_message::prelude::*;

use core::{convert::TryInto, str::FromStr};
use core::str::FromStr;

const ED25519_ADDRESS: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649";
const ED25519_ADDRESS_INVALID_HEX: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c64x";
Expand Down
2 changes: 0 additions & 2 deletions bee-message/tests/ed25519_signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use bee_common::packable::Packable;
use bee_message::prelude::*;

use core::convert::TryInto;

const ED25519_PUBLIC_KEY: &str = "1da5ddd11ba3f961acab68fafee3177d039875eaa94ac5fdbff8b53f0c50bfb9";
const ED25519_SIGNATURE: &str = "c6a40edf9a089f42c18f4ebccb35fe4b578d93b879e99b87f63573324a710d3456b03fb6d1fcc027e6401cbd9581f790ee3ed7a3f68e9c225fcb9f1cd7b7110d";

Expand Down
2 changes: 0 additions & 2 deletions bee-message/tests/indexation_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use bee_common::packable::Packable;
use bee_message::prelude::*;
use bee_test::rand::bytes::{rand_bytes, rand_bytes_32};

use std::convert::TryInto;

const PADDED_INDEX: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c64952fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649";

#[test]
Expand Down
1 change: 0 additions & 1 deletion bee-message/tests/milestone_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use bee_common::packable::Packable;
use bee_message::prelude::*;

use core::str::FromStr;
use std::convert::TryInto;

const MILESTONE_ID: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649";
const MILESTONE_ID_INVALID_HEX: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c64x";
Expand Down
5 changes: 1 addition & 4 deletions bee-message/tests/output_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
use bee_common::packable::Packable;
use bee_message::prelude::*;

use core::{
convert::{TryFrom, TryInto},
str::FromStr,
};
use core::str::FromStr;

const TRANSACTION_ID: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649";
const OUTPUT_ID: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c6492a00";
Expand Down
2 changes: 1 addition & 1 deletion bee-message/tests/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use bee_common::packable::Packable;
use bee_message::prelude::*;
use bee_test::rand::{bytes::rand_bytes_32, parents::rand_parents};

use std::{convert::TryInto, str::FromStr};
use std::str::FromStr;

const TRANSACTION_ID: &str = "24a1f46bdb6b2bf38f1c59f73cdd4ae5b418804bb231d76d06fbf246498d5883";
const ED25519_ADDRESS: &str = "e594f9a895c0e0a6760dd12cffc2c3d1e1cbf7269b328091f96ce3d0dd550b75";
Expand Down
2 changes: 0 additions & 2 deletions bee-message/tests/reference_unlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use bee_common::packable::Packable;
use bee_message::prelude::*;

use core::convert::TryFrom;

#[test]
fn kind() {
assert_eq!(ReferenceUnlock::KIND, 1);
Expand Down
2 changes: 0 additions & 2 deletions bee-message/tests/signature_unlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use bee_common::packable::Packable;
use bee_message::prelude::*;
use bee_test::rand::bytes::{rand_bytes, rand_bytes_32};

use std::convert::TryInto;

#[test]
fn unlock_kind() {
assert_eq!(SignatureUnlock::KIND, 0);
Expand Down
2 changes: 0 additions & 2 deletions bee-message/tests/tail_transaction_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use bee_common::packable::Packable;
use bee_message::prelude::*;

use core::convert::TryFrom;

const HASH_TRYTES: &str = "TZTXLMTAURX9DYQICXZEUMCDBPNXVOHNBBZDSSVCNCTWKSMUALAYPMHUCKGOGSTBUHSQIMSY9HQEP9AXJ";
const HASH_BYTES: [u8; 49] = [
222, 235, 107, 67, 2, 173, 253, 93, 165, 90, 166, 45, 102, 91, 19, 137, 71, 146, 156, 180, 248, 31, 56, 25, 68,
Expand Down
2 changes: 0 additions & 2 deletions bee-message/tests/transaction_essence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use bee_common::packable::Packable;
use bee_message::prelude::*;

use std::convert::TryInto;

const TRANSACTION_ID: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649";
const ED25519_ADDRESS: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649";

Expand Down
2 changes: 0 additions & 2 deletions bee-message/tests/transaction_payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use bee_common::packable::Packable;
use bee_message::{input::Input, payload::transaction::Essence, prelude::*};

use core::convert::TryInto;

const TRANSACTION_ID: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649";
const ED25519_ADDRESS: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649";
const ED25519_PUBLIC_KEY: &str = "1da5ddd11ba3f961acab68fafee3177d039875eaa94ac5fdbff8b53f0c50bfb9";
Expand Down
2 changes: 0 additions & 2 deletions bee-message/tests/transaction_regular_essence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ use bee_test::rand::{
payload::{rand_indexation_payload, rand_treasury_transaction_payload},
};

use std::convert::TryInto;

const TRANSACTION_ID: &str = "52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649";
const ED25519_ADDRESS_1: &str = "d56da1eb7726ed482dfe9d457cf548c2ae2a6ce3e053dbf82f11223be476adb9";
const ED25519_ADDRESS_2: &str = "efda4275375ac3675abff85235fd25a1522a2044cc6027a31b310857246f18c0";
Expand Down
2 changes: 0 additions & 2 deletions bee-message/tests/unlock_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use bee_message::prelude::*;
use bee_test::rand::bytes::{rand_bytes, rand_bytes_32};

use core::convert::TryInto;

#[test]
fn kind() {
assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion bee-network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bee-network"
version = "0.2.2"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = """
Networking functionality and types for nodes and clients participating in the IOTA protocol built on top of `libp2p`.
"""
Expand Down
2 changes: 1 addition & 1 deletion bee-pow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bee-pow"
version = "0.1.0"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = "Provides Proof of Work utilities for the IOTA protocol"
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
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.1"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = "All types and workers enabling the IOTA protocol"
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
Expand Down
2 changes: 1 addition & 1 deletion bee-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bee-runtime"
version = "0.1.1-alpha"
authors = [ "IOTA Stiftung" ]
edition = "2018"
edition = "2021"
description = "Runtime components and utilities for the bee framework"
readme = "README.md"
repository = "https://github.com/iotaledger/bee"
Expand Down
Loading

0 comments on commit e026b4c

Please sign in to comment.