From 8f9ac1d96c3b3eee9847580ecea6c8f292322d9f Mon Sep 17 00:00:00 2001 From: Dan Robertson Date: Mon, 18 Jun 2018 01:34:58 +0000 Subject: [PATCH] Update docs and fix warnings Closes: #238 Approved by: dlrobertson --- src/lib.rs | 2 +- src/socket/icmp.rs | 10 +++++----- src/wire/icmpv6.rs | 2 +- src/wire/ipv6routing.rs | 12 ++++++------ src/wire/ndisc.rs | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 234470ffd..09a3fa0b9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,7 +72,7 @@ //! | ARP | Yes | Yes | //! | IPv4 | Yes | Yes | //! | ICMPv4 | Yes | Yes | -//! | IGMPv1/2 | Yes | No | +//! | IGMPv1/2 | Yes | Yes | //! | IPv6 | Yes | Yes | //! | ICMPv6 | Yes | Yes | //! | TCP | Yes | Yes | diff --git a/src/socket/icmp.rs b/src/socket/icmp.rs index 03b67070b..5db9ba922 100644 --- a/src/socket/icmp.rs +++ b/src/socket/icmp.rs @@ -38,15 +38,15 @@ impl Default for Endpoint { fn default() -> Endpoint { Endpoint::Unspecified } } -/// An ICMPv4 packet metadata. +/// An ICMP packet metadata. pub type IcmpPacketMetadata = PacketMetadata; -/// An ICMPv4 packet ring buffer. +/// An ICMP packet ring buffer. pub type IcmpSocketBuffer<'a, 'b> = PacketBuffer<'a, 'b, IpAddress>; -/// An ICMPv4 socket +/// A ICMP socket /// -/// An ICMPv4 socket is bound to a specific [IcmpEndpoint] which may +/// An ICMP socket is bound to a specific [IcmpEndpoint] which may /// be a sepecific UDP port to listen for ICMP error messages related /// to the port or a specific ICMP identifier value. See [bind] for /// more details. @@ -65,7 +65,7 @@ pub struct IcmpSocket<'a, 'b: 'a> { } impl<'a, 'b> IcmpSocket<'a, 'b> { - /// Create an ICMPv4 socket with the given buffers. + /// Create an ICMP socket with the given buffers. pub fn new(rx_buffer: IcmpSocketBuffer<'a, 'b>, tx_buffer: IcmpSocketBuffer<'a, 'b>) -> IcmpSocket<'a, 'b> { IcmpSocket { diff --git a/src/wire/icmpv6.rs b/src/wire/icmpv6.rs index bf58fc893..d8bad695d 100644 --- a/src/wire/icmpv6.rs +++ b/src/wire/icmpv6.rs @@ -398,7 +398,7 @@ impl + AsMut<[u8]>> Packet { /// Set the pointer field (for parameter problem messages). /// /// # Panics - /// This function may panic if this packet + /// This function may panic if this packet is not a parameter problem message. #[inline] pub fn set_param_problem_ptr(&mut self, value: u32) { let data = self.buffer.as_mut(); diff --git a/src/wire/ipv6routing.rs b/src/wire/ipv6routing.rs index 68c4a31b1..b64d21bd9 100644 --- a/src/wire/ipv6routing.rs +++ b/src/wire/ipv6routing.rs @@ -234,7 +234,7 @@ impl> Header { } - /// Return the number of prefix octects elided from the last address (addresses[n]). + /// Return the number of prefix octects elided from the last address (`addresses[n]`). /// /// # Panics /// This function may panic if this header is not the RPL Source Routing Header routing type. @@ -243,7 +243,7 @@ impl> Header { data[field::CMPR] & 0xf } - /// Return the number of octects used for padding after addresses[n]. + /// Return the number of octects used for padding after `addresses[n]`. /// /// # Panics /// This function may panic if this header is not the RPL Source Routing Header routing type. @@ -344,7 +344,7 @@ impl + AsMut<[u8]>> Header { data[field::CMPR] = raw; } - /// Set the number of prefix octects elided from the last address (addresses[n]). + /// Set the number of prefix octects elided from the last address (`addresses[n]`). /// /// # Panics /// This function may panic if this header is not the RPL Source Routing Header routing type. @@ -354,7 +354,7 @@ impl + AsMut<[u8]>> Header { data[field::CMPR] = raw; } - /// Set the number of octects used for padding after addresses[n]. + /// Set the number of octects used for padding after `addresses[n]`. /// /// # Panics /// This function may panic if this header is not the RPL Source Routing Header routing type. @@ -411,10 +411,10 @@ pub enum Repr<'a> { cmpr_i: u8, /// Number of prefix octets from the last segment that are elided. cmpr_e: u8, - /// Number of octets that are used for padding after Address[n] at the end of the + /// Number of octets that are used for padding after `address[n]` at the end of the /// RPL Source Route Header. pad: u8, - /// Vector of addresses, numbered 1 to n. + /// Vector of addresses, numbered 1 to `n`. addresses: &'a[u8], }, diff --git a/src/wire/ndisc.rs b/src/wire/ndisc.rs index a940390ef..343b2b652 100644 --- a/src/wire/ndisc.rs +++ b/src/wire/ndisc.rs @@ -63,7 +63,7 @@ impl> Packet { } } -/// Getters for the [Neighbor Solicitation], [Neighbor Advertisement], and +/// Common getters for the [Neighbor Solicitation], [Neighbor Advertisement], and /// [Redirect] message types. /// /// [Neighbor Solicitation]: https://tools.ietf.org/html/rfc4861#section-4.3 @@ -158,7 +158,7 @@ impl + AsMut<[u8]>> Packet { } } -/// Setters for the [Neighbor Solicitation], [Neighbor Advertisement], and +/// Common setters for the [Neighbor Solicitation], [Neighbor Advertisement], and /// [Redirect] message types. /// /// [Neighbor Solicitation]: https://tools.ietf.org/html/rfc4861#section-4.3