Skip to content

Commit

Permalink
fix: typos (#104)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgzones authored and EstebanBorai committed Mar 1, 2023
1 parent 109ff03 commit ba587ce
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ project.

Not all interactions that require remediation are clear violations
of the Code of Conduct. Project maintainers will take appropriate
action, when neccessary, to ensure the zwnbsp community is a space
action, when necessary, to ensure the zwnbsp community is a space
where individuals can comfortably collaborate and bring their
entire selves. Unfortunately, if bringing your entire self is
infringing on others from doing the same, you may be asked to leave.
Expand Down
6 changes: 3 additions & 3 deletions src/bsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub struct AfInetInfo {
pub is_loopback: bool,
}

// Internal methos to list AF_INET info in a struct. This metho is used by
// Internal method to list AF_INET info in a struct. This metho is used by
// list_afiinet_netifas and local_ip,
pub fn list_afinet_netifas_info() -> Result<Vec<AfInetInfo>, Error> {
unsafe {
Expand All @@ -53,7 +53,7 @@ pub fn list_afinet_netifas_info() -> Result<Vec<AfInetInfo>, Error> {
let getifaddrs_result = getifaddrs(myaddr);

if getifaddrs_result != 0 {
// an error ocurred on getifaddrs
// an error occurred on getifaddrs
return Err(Error::StrategyError(format!(
"GetIfAddrs returned error: {}",
getifaddrs_result
Expand Down Expand Up @@ -83,7 +83,7 @@ pub fn list_afinet_netifas_info() -> Result<Vec<AfInetInfo>, Error> {
if cfg!(target_endian = "little") {
// due to a difference on how bytes are arranged on a
// single word of memory by the CPU, swap bytes based
// on CPU endianess to avoid having twisted IP addresses
// on CPU endianness to avoid having twisted IP addresses
//
// refer: https://github.com/rust-lang/rust/issues/48819
ip_addr = Ipv4Addr::from(in_addr.s_addr.swap_bytes());
Expand Down
4 changes: 2 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ pub enum Error {
LocalIpAddressNotFound,
/// Returned when an error occurs in the strategy level.
/// The error message may include any internal strategy error if available
#[error("An error ocurred executing the underlying strategy error.\n{0}")]
#[error("An error occurred executing the underlying strategy error.\n{0}")]
StrategyError(String),
/// Returned when the current platform is not yet supported
#[error("The current platform: `{0}`, is not suppported")]
#[error("The current platform: `{0}`, is not supported")]
PlatformNotSupported(String),
}
12 changes: 6 additions & 6 deletions src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub fn local_ip() -> Result<IpAddr, Error> {
for response in netlink_socket.iter(false) {
let header: Nlmsghdr<Rtm, Rtmsg> = response.map_err(|_| {
Error::StrategyError(String::from(
"An error ocurred retrieving Netlink's socket response",
"An error occurred retrieving Netlink's socket response",
))
})?;

Expand All @@ -71,7 +71,7 @@ pub fn local_ip() -> Result<IpAddr, Error> {

let p = header.get_payload().map_err(|_| {
Error::StrategyError(String::from(
"An error ocurred getting Netlink's header payload",
"An error occurred getting Netlink's header payload",
))
})?;

Expand All @@ -84,7 +84,7 @@ pub fn local_ip() -> Result<IpAddr, Error> {
let addr = Ipv4Addr::from(u32::from_be(rtattr.get_payload_as::<u32>().map_err(
|_| {
Error::StrategyError(String::from(
"An error ocurred retrieving Netlink's route payload attribute",
"An error occurred retrieving Netlink's route payload attribute",
))
},
)?));
Expand Down Expand Up @@ -117,7 +117,7 @@ pub fn local_ip() -> Result<IpAddr, Error> {
for response in netlink_socket.iter(false) {
let header: Nlmsghdr<Rtm, Ifaddrmsg> = response.map_err(|_| {
Error::StrategyError(String::from(
"An error ocurred retrieving Netlink's socket response",
"An error occurred retrieving Netlink's socket response",
))
})?;

Expand All @@ -133,7 +133,7 @@ pub fn local_ip() -> Result<IpAddr, Error> {

let p = header.get_payload().map_err(|_| {
Error::StrategyError(String::from(
"An error ocurred getting Netlink's header payload",
"An error occurred getting Netlink's header payload",
))
})?;

Expand All @@ -146,7 +146,7 @@ pub fn local_ip() -> Result<IpAddr, Error> {
let addr = Ipv4Addr::from(u32::from_be(rtattr.get_payload_as::<u32>().map_err(
|_| {
Error::StrategyError(String::from(
"An error ocurred retrieving Netlink's route payload attribute",
"An error occurred retrieving Netlink's route payload attribute",
))
},
)?));
Expand Down
4 changes: 2 additions & 2 deletions src/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub fn list_afinet_netifas() -> Result<Vec<(String, IpAddr)>, Error> {
let getifaddrs_result = getifaddrs(myaddr);

if getifaddrs_result != 0 {
// an error ocurred on getifaddrs
// an error occurred on getifaddrs
return Err(Error::StrategyError(format!(
"GetIfAddrs returned error: {}",
getifaddrs_result
Expand Down Expand Up @@ -65,7 +65,7 @@ pub fn list_afinet_netifas() -> Result<Vec<(String, IpAddr)>, Error> {
if cfg!(target_endian = "little") {
// due to a difference on how bytes are arranged on a
// single word of memory by the CPU, swap bytes based
// on CPU endianess to avoid having twisted IP addresses
// on CPU endianness to avoid having twisted IP addresses
//
// refer: https://github.com/rust-lang/rust/issues/48819
ip_addr = Ipv4Addr::from(in_addr.s_addr.swap_bytes());
Expand Down

0 comments on commit ba587ce

Please sign in to comment.