Skip to content

Commit

Permalink
Spell check with typos. Add spell-check CI job
Browse files Browse the repository at this point in the history
  • Loading branch information
vvv committed Jul 2, 2023
1 parent f5ab216 commit 4801969
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -13,6 +13,12 @@ env:
VERBOSE: 1

jobs:
spell-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: crate-ci/typos@master

build-ubuntu:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion pnet_base/src/macaddr.rs
Expand Up @@ -310,7 +310,7 @@ mod tests {
}

#[test]
fn convertion() {
fn conversion() {
let mac = MacAddr(0x12, 0x34, 0x56, 0x78, 0x90, 0xAB);
let addr = [0x12, 0x34, 0x56, 0x78, 0x90, 0xAB];

Expand Down
4 changes: 2 additions & 2 deletions pnet_datalink/src/bpf.rs
Expand Up @@ -294,7 +294,7 @@ impl DataLinkSender for DataLinkSenderImpl {
)
};
if ret == -1 {
// Error occured!
// Error occurred!
return Some(Err(io::Error::last_os_error()));
} else if ret == 0 {
return Some(Err(io::Error::new(io::ErrorKind::TimedOut, "Timed out")));
Expand Down Expand Up @@ -339,7 +339,7 @@ impl DataLinkSender for DataLinkSenderImpl {
)
};
if ret == -1 {
// Error occured!
// Error occurred!
return Some(Err(io::Error::last_os_error()));
} else if ret == 0 {
return Some(Err(io::Error::new(io::ErrorKind::TimedOut, "Timed out")));
Expand Down
2 changes: 1 addition & 1 deletion pnet_datalink/src/winpcap.rs
Expand Up @@ -343,7 +343,7 @@ pub fn interfaces() -> Vec<NetworkInterface> {
buf.resize(buflen as usize, 0);

// Second call should now work with the correct buffer size. If not, this may be
// due to some privilege or other unforseen issue.
// due to some privilege or other unforeseen issue.
if unsafe { winpcap::PacketGetAdapterNames(buf.as_mut_ptr() as *mut i8, &mut buflen) } == 0
{
panic!("Unable to get interface list despite increasing buffer size");
Expand Down
2 changes: 1 addition & 1 deletion pnet_sys/src/lib.rs
Expand Up @@ -111,7 +111,7 @@ pub fn set_socket_receive_timeout(socket: CSocket, t: Duration) -> io::Result<()
}
}

/// Extracts and returns a timout for reading from the socket.
/// Extracts and returns a timeout for reading from the socket.
#[cfg(unix)]
pub fn get_socket_receive_timeout(socket: CSocket) -> io::Result<Duration> {
let ts = libc::timeval {
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Expand Up @@ -31,7 +31,7 @@
//!
//! ## Terminology
//!
//! The documentation uses the following terms interchangably:
//! The documentation uses the following terms interchangeably:
//!
//! * Layer 2, datalink layer;
//! * Layer 3, network layer;
Expand All @@ -48,7 +48,7 @@
//! ### Ethernet echo server
//!
//! This (fairly useless) code implements an Ethernet echo server. Whenever a
//! packet is received on an interface, it echo's the packet back; reversing the
//! packet is received on an interface, it echoes the packet back; reversing the
//! source and destination addresses.
//!
//! ```rust,ignore
Expand Down
6 changes: 6 additions & 0 deletions typos.toml
@@ -0,0 +1,6 @@
[default]
extend-ignore-identifiers-re = [
"tolen",
"ND",
"SunNd",
]

0 comments on commit 4801969

Please sign in to comment.