Manual import cleanup

This commit is contained in:
Linus Färnstrand
2019-03-25 15:23:21 +01:00
parent 61eeb5843f
commit a6dfadc21d
6 changed files with 9 additions and 39 deletions

View File

@ -1,10 +1,5 @@
#[macro_use] use criterion::{criterion_group, criterion_main, Criterion};
extern crate criterion;
use ipnetwork::{Ipv4Network, Ipv6Network}; use ipnetwork::{Ipv4Network, Ipv6Network};
use criterion::Criterion;
use std::net::{Ipv4Addr, Ipv6Addr}; use std::net::{Ipv4Addr, Ipv6Addr};
fn parse_ipv4_benchmark(c: &mut Criterion) { fn parse_ipv4_benchmark(c: &mut Criterion) {

View File

@ -1,5 +1,4 @@
use std::error::Error; use std::{error::Error, fmt};
use std::fmt;
/// Represents a bunch of errors that can occur while working with a `IpNetwork` /// Represents a bunch of errors that can occur while working with a `IpNetwork`
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq)]

View File

@ -1,10 +1,6 @@
use std::fmt;
use std::net::Ipv4Addr;
use std::str::FromStr;
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use crate::common::{cidr_parts, parse_prefix, IpNetworkError}; use crate::common::{cidr_parts, parse_prefix, IpNetworkError};
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use std::{fmt, net::Ipv4Addr, str::FromStr};
const IPV4_BITS: u8 = 32; const IPV4_BITS: u8 = 32;

View File

@ -1,11 +1,6 @@
use std::cmp;
use std::fmt;
use std::net::Ipv6Addr;
use std::str::FromStr;
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use crate::common::{cidr_parts, parse_prefix, IpNetworkError}; use crate::common::{cidr_parts, parse_prefix, IpNetworkError};
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use std::{cmp, fmt, net::Ipv6Addr, str::FromStr};
const IPV6_BITS: u8 = 128; const IPV6_BITS: u8 = 128;
const IPV6_SEGMENT_BITS: u8 = 16; const IPV6_SEGMENT_BITS: u8 = 16;

View File

@ -6,19 +6,13 @@
#![crate_type = "lib"] #![crate_type = "lib"]
#![doc(html_root_url = "https://docs.rs/ipnetwork/0.14.0")] #![doc(html_root_url = "https://docs.rs/ipnetwork/0.14.0")]
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
use std::{fmt, net::IpAddr, str::FromStr};
use std::fmt;
use std::net::IpAddr;
mod common; mod common;
mod ipv4; mod ipv4;
mod ipv6; mod ipv6;
use std::str::FromStr;
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
pub use crate::common::IpNetworkError; pub use crate::common::IpNetworkError;
pub use crate::ipv4::{ipv4_mask_to_prefix, Ipv4Network}; pub use crate::ipv4::{ipv4_mask_to_prefix, Ipv4Network};
pub use crate::ipv6::{ipv6_mask_to_prefix, Ipv6Network}; pub use crate::ipv6::{ipv6_mask_to_prefix, Ipv6Network};

View File

@ -1,16 +1,7 @@
#[macro_use]
extern crate serde_derive;
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use ipnetwork::{IpNetwork, Ipv4Network, Ipv6Network}; use ipnetwork::{IpNetwork, Ipv4Network, Ipv6Network};
use serde_derive::{Deserialize, Serialize};
use std::net::{Ipv4Addr, Ipv6Addr}; use std::net::{Ipv4Addr, Ipv6Addr};
#[test] #[test]