mirror of
https://github.com/achanda/ipnetwork.git
synced 2025-06-16 16:58:50 +00:00
Run cargo fix --edition-idioms
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#[macro_use]
|
||||
extern crate criterion;
|
||||
extern crate ipnetwork;
|
||||
|
||||
|
||||
use ipnetwork::{Ipv4Network, Ipv6Network};
|
||||
use criterion::Criterion;
|
||||
|
@ -10,7 +10,7 @@ pub enum 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 crate::IpNetworkError::*;
|
||||
match *self {
|
||||
InvalidAddr(ref s) => write!(f, "invalid address: {}", s),
|
||||
|
@ -204,7 +204,7 @@ impl Ipv4Network {
|
||||
}
|
||||
|
||||
impl fmt::Display for Ipv4Network {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(fmt, "{}/{}", self.ip(), self.prefix())
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ impl Iterator for Ipv6NetworkIterator {
|
||||
}
|
||||
|
||||
impl fmt::Display for Ipv6Network {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(fmt, "{}/{}", self.ip(), self.prefix())
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,7 @@
|
||||
#![crate_type = "lib"]
|
||||
#![doc(html_root_url = "https://docs.rs/ipnetwork/0.14.0")]
|
||||
|
||||
extern crate serde;
|
||||
|
||||
|
||||
use std::fmt;
|
||||
use std::net::IpAddr;
|
||||
@ -296,7 +296,7 @@ impl From<IpAddr> for IpNetwork {
|
||||
}
|
||||
|
||||
impl fmt::Display for IpNetwork {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match *self {
|
||||
IpNetwork::V4(net) => net.fmt(f),
|
||||
IpNetwork::V6(net) => net.fmt(f),
|
||||
|
@ -1,11 +1,11 @@
|
||||
extern crate serde;
|
||||
|
||||
extern crate serde_json;
|
||||
|
||||
|
||||
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
extern crate ipnetwork;
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
Reference in New Issue
Block a user