mirror of
https://github.com/achanda/ipnetwork.git
synced 2025-06-16 16:58:50 +00:00
Run cargo fix --edition
This commit is contained in:
@ -11,7 +11,7 @@ pub enum IpNetworkError {
|
|||||||
|
|
||||||
impl fmt::Display for IpNetworkError {
|
impl fmt::Display for IpNetworkError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
use IpNetworkError::*;
|
use crate::IpNetworkError::*;
|
||||||
match *self {
|
match *self {
|
||||||
InvalidAddr(ref s) => write!(f, "invalid address: {}", s),
|
InvalidAddr(ref s) => write!(f, "invalid address: {}", s),
|
||||||
InvalidPrefix => write!(f, "invalid prefix"),
|
InvalidPrefix => write!(f, "invalid prefix"),
|
||||||
@ -22,7 +22,7 @@ impl fmt::Display for IpNetworkError {
|
|||||||
|
|
||||||
impl Error for IpNetworkError {
|
impl Error for IpNetworkError {
|
||||||
fn description(&self) -> &str {
|
fn description(&self) -> &str {
|
||||||
use IpNetworkError::*;
|
use crate::IpNetworkError::*;
|
||||||
match *self {
|
match *self {
|
||||||
InvalidAddr(_) => "address is invalid",
|
InvalidAddr(_) => "address is invalid",
|
||||||
InvalidPrefix => "prefix is invalid",
|
InvalidPrefix => "prefix is invalid",
|
||||||
|
@ -4,7 +4,7 @@ use std::str::FromStr;
|
|||||||
|
|
||||||
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
||||||
|
|
||||||
use common::{cidr_parts, parse_prefix, IpNetworkError};
|
use crate::common::{cidr_parts, parse_prefix, IpNetworkError};
|
||||||
|
|
||||||
const IPV4_BITS: u8 = 32;
|
const IPV4_BITS: u8 = 32;
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ use std::str::FromStr;
|
|||||||
|
|
||||||
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
||||||
|
|
||||||
use common::{cidr_parts, parse_prefix, IpNetworkError};
|
use crate::common::{cidr_parts, parse_prefix, IpNetworkError};
|
||||||
|
|
||||||
const IPV6_BITS: u8 = 128;
|
const IPV6_BITS: u8 = 128;
|
||||||
const IPV6_SEGMENT_BITS: u8 = 16;
|
const IPV6_SEGMENT_BITS: u8 = 16;
|
||||||
|
@ -19,9 +19,9 @@ use std::str::FromStr;
|
|||||||
|
|
||||||
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
||||||
|
|
||||||
pub use common::IpNetworkError;
|
pub use crate::common::IpNetworkError;
|
||||||
pub use ipv4::{ipv4_mask_to_prefix, Ipv4Network};
|
pub use crate::ipv4::{ipv4_mask_to_prefix, Ipv4Network};
|
||||||
pub use ipv6::{ipv6_mask_to_prefix, Ipv6Network};
|
pub use crate::ipv6::{ipv6_mask_to_prefix, Ipv6Network};
|
||||||
|
|
||||||
/// Represents a generic network range. This type can have two variants:
|
/// Represents a generic network range. This type can have two variants:
|
||||||
/// the v4 and the v6 case.
|
/// the v4 and the v6 case.
|
||||||
|
Reference in New Issue
Block a user