Skip to content

Commit

Permalink
chore: Remove (now unnecessary) imports. (openmls#1395)
Browse files Browse the repository at this point in the history
`TryFrom`, `TryInto`, and `FromIterator` are in Rust's 2021 prelude.

Co-authored-by: Konrad Kohbrok <[email protected]>
  • Loading branch information
duesee and kkohbrok authored May 31, 2023
1 parent 1374c7d commit e6a8a56
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion interop_client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//!
//! It is based on the Mock client in that repository.
use std::{collections::HashMap, convert::TryFrom, fmt::Display, fs::File, io::Write, sync::Mutex};
use std::{collections::HashMap, fmt::Display, fs::File, io::Write, sync::Mutex};

use clap::Parser;
use clap_derive::*;
Expand Down
5 changes: 1 addition & 4 deletions openmls/src/credentials/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
//! There are multiple [`CredentialType`]s, although OpenMLS currently only
//! supports the [`BasicCredential`].
use std::{
convert::TryFrom,
io::{Read, Write},
};
use std::io::{Read, Write};

use serde::{Deserialize, Serialize};
use tls_codec::{TlsDeserialize, TlsSerialize, TlsSize, VLBytes};
Expand Down
2 changes: 1 addition & 1 deletion openmls/src/framing/public_message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! A PublicMessage is a framing structure for MLS messages. It can contain
//! Proposals, Commits and application messages.
use std::{convert::TryFrom, io::Write};
use std::io::Write;

use openmls_traits::{crypto::OpenMlsCrypto, types::Ciphersuite, OpenMlsCryptoProvider};
use tls_codec::{Serialize as TlsSerializeTrait, TlsDeserialize, TlsSerialize, TlsSize};
Expand Down
5 changes: 1 addition & 4 deletions openmls/src/framing/public_message_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ use super::{
};

use openmls_traits::OpenMlsCryptoProvider;
use std::{
convert::TryFrom,
io::{Read, Write},
};
use std::io::{Read, Write};
use tls_codec::{
Deserialize as TlsDeserializeTrait, Serialize as TlsSerializeTrait, TlsSerialize, TlsSize,
};
Expand Down
2 changes: 0 additions & 2 deletions openmls/src/group/tests/kat_transcript_hashes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
//! See <https://github.com/mlswg/mls-implementations/blob/master/test-vectors.md>
//! for more description on the test vectors.
use std::convert::TryFrom;

use openmls_rust_crypto::OpenMlsRustCrypto;
use openmls_traits::{crypto::OpenMlsCrypto, random::OpenMlsRand, OpenMlsCryptoProvider};
use serde::{self, Deserialize, Serialize};
Expand Down
2 changes: 0 additions & 2 deletions openmls/src/tree/tests_and_kats/kats/kat_encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@
//! Keys](https://github.com/mlswg/mls-protocol/blob/master/draft-ietf-mls-protocol.md#encryption-keys)
//! section of the specification.
use std::convert::TryFrom;

use itertools::izip;
use openmls_basic_credential::SignatureKeyPair;
use openmls_rust_crypto::OpenMlsRustCrypto;
Expand Down
1 change: 0 additions & 1 deletion openmls/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ macro_rules! log_content {
/// HashMap or a BTreeMap) into a vector of tuples and vice versa.
pub mod vector_converter {
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use std::iter::FromIterator;

pub fn serialize<'a, T, K, V, S>(target: T, ser: S) -> Result<S::Ok, S::Error>
where
Expand Down
2 changes: 1 addition & 1 deletion openmls/src/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Only MLS 1.0 is currently supported.
use serde::{Deserialize, Serialize};
use std::{convert::TryFrom, fmt};
use std::fmt;
use thiserror::Error;
use tls_codec::{TlsDeserialize, TlsSerialize, TlsSize};

Expand Down
2 changes: 1 addition & 1 deletion traits/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! This module holds a number of types that are needed by the traits.
use std::{convert::TryFrom, ops::Deref};
use std::ops::Deref;

use serde::{Deserialize, Serialize};
use tls_codec::{SecretVLBytes, TlsDeserialize, TlsSerialize, TlsSize, VLBytes};
Expand Down

0 comments on commit e6a8a56

Please sign in to comment.