Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: derive more traits for structs and enums #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pub use no_std_net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, Socke
use core::str::FromStr;
use heapless::String;

#[derive(Debug)]
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct HostAddr {
ip: IpAddr,
hostname: Option<String<256>>,
Expand Down Expand Up @@ -37,7 +37,7 @@ impl HostAddr {
}
}

#[derive(Debug)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct AddrParseError;

impl FromStr for HostAddr {
Expand All @@ -57,7 +57,7 @@ impl From<IpAddr> for HostAddr {
}
}

#[derive(Debug)]
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct HostSocketAddr {
addr: HostAddr,
port: u16,
Expand Down
4 changes: 2 additions & 2 deletions src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use no_std_net::IpAddr;
use core::fmt::Debug;

/// DNS errors
#[derive(Debug)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DnsError {
UnsupportedAddressType,
NoSuchHost,
Expand All @@ -16,7 +16,7 @@ pub enum DnsError {
///
/// An IPv4 address type always looks for `A` records, while IPv6 address type
/// will look for `AAAA` records
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum AddrType {
/// Result is `A` record
IPv4,
Expand Down
4 changes: 2 additions & 2 deletions src/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub enum Mode {

/// Network errors
#[non_exhaustive]
#[derive(Debug)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum TcpError {
NoAvailableSockets,
ConnectionRefused,
Expand All @@ -27,7 +27,7 @@ pub enum TcpError {
}

#[non_exhaustive]
#[derive(Debug)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum TcpImplError {
InitializationError,
ErrorCode(u32),
Expand Down
2 changes: 0 additions & 2 deletions src/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,3 @@ pub trait UdpStack {
/// Close an existing UDP socket.
fn close(&self, socket: Self::UdpSocket) -> Result<(), Self::Error>;
}

// End Of File