mirror of
https://github.com/openharmony/third_party_rust_ipnet.git
synced 2026-06-30 20:27:55 -04:00
fix some typos
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
This module provides types and useful methods for working with IPv4 and IPv6 network addresses, commonly called IP prefixes. The new `IpNet`, `Ipv4Net`, and `Ipv6Net` types build on the existing `IpAddr`, `Ipv4Addr`, and `Ipv6Addr` types already provided in Rust's standard library and align to their design to stay consistent.
|
||||
|
||||
The module also provides the `IpSubnets`, `Ipv4Subnets`, and `Ipv6Subnets` types for interating over the subnets contained in an IP address range. The `IpAddrRange`, `Ipv4AddrRange`, and `Ipv6AddrRange` types for iterating over IP addresses in a range. And traits that extend `Ipv4Addr` and `Ipv6Addr` with methods for addition, subtraction, bitwise-and, and bitwise-or operations that are missing in Rust's standard library.
|
||||
The module also provides the `IpSubnets`, `Ipv4Subnets`, and `Ipv6Subnets` types for iterating over the subnets contained in an IP address range. The `IpAddrRange`, `Ipv4AddrRange`, and `Ipv6AddrRange` types for iterating over IP addresses in a range. And traits that extend `Ipv4Addr` and `Ipv6Addr` with methods for addition, subtraction, bitwise-and, and bitwise-or operations that are missing in Rust's standard library.
|
||||
|
||||
The module only uses stable features so it is guaranteed to compile using the stable toolchain. Tests aim for thorough coverage and can be found in both the test modules and doctests. Please file an [issue on GitHub] if you have any problems, requests, or suggested improvements.
|
||||
|
||||
|
||||
+2
-2
@@ -479,7 +479,7 @@ impl Iterator for Ipv4AddrRange {
|
||||
let count: u32 = self.end.saturating_sub(self.start);
|
||||
|
||||
// usize might only be 16 bits,
|
||||
// so need to explicitely check for overflow.
|
||||
// so need to explicitly check for overflow.
|
||||
// 'usize::MAX as u32' is okay here - if usize is 64 bits,
|
||||
// value truncates to u32::MAX
|
||||
if count <= std::usize::MAX as u32 {
|
||||
@@ -963,4 +963,4 @@ mod tests {
|
||||
assert_eq!(i3.nth_back(99), None);
|
||||
assert_eq!(i3.next(), None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1258,7 +1258,7 @@ impl<'a> Contains<&'a Ipv6Addr> for Ipv6Net {
|
||||
/// Generates the subnets between the provided `start` and `end` IP
|
||||
/// addresses inclusive of `end`. Each iteration generates the next
|
||||
/// network address of the largest valid size it can, while using a
|
||||
/// prefix lenth not less than `min_prefix_len`.
|
||||
/// prefix length not less than `min_prefix_len`.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@@ -1305,7 +1305,7 @@ pub enum IpSubnets {
|
||||
/// Generates the subnets between the provided `start` and `end` IP
|
||||
/// addresses inclusive of `end`. Each iteration generates the next
|
||||
/// network address of the largest valid size it can, while using a
|
||||
/// prefix lenth not less than `min_prefix_len`.
|
||||
/// prefix length not less than `min_prefix_len`.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
@@ -1339,7 +1339,7 @@ pub struct Ipv4Subnets {
|
||||
/// Generates the subnets between the provided `start` and `end` IP
|
||||
/// addresses inclusive of `end`. Each iteration generates the next
|
||||
/// network address of the largest valid size it can, while using a
|
||||
/// prefix lenth not less than `min_prefix_len`.
|
||||
/// prefix length not less than `min_prefix_len`.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
//! consistent.
|
||||
//!
|
||||
//! The module also provides the [`IpSubnets`], [`Ipv4Subnets`], and
|
||||
//! [`Ipv6Subnets`] types for interating over the subnets contained in
|
||||
//! [`Ipv6Subnets`] types for iterating over the subnets contained in
|
||||
//! an IP address range. The [`IpAddrRange`], [`Ipv4AddrRange`], and
|
||||
//! [`Ipv6AddrRange`] types for iterating over IP addresses in a range.
|
||||
//! And traits that extend `Ipv4Addr` and `Ipv6Addr` with methods for
|
||||
|
||||
Reference in New Issue
Block a user