Skip to content

Spell check with typos. Add spell-check CI job#621

Merged
mrmonday merged 3 commits intolibpnet:masterfrom
vvv:spell-check
Jul 19, 2023
Merged

Spell check with typos. Add spell-check CI job#621
mrmonday merged 3 commits intolibpnet:masterfrom
vvv:spell-check

Conversation

@vvv
Copy link
Copy Markdown
Contributor

@vvv vvv commented Jul 2, 2023

Other changes

Fix the unit tests

Update length_expr_parentheses.stderr to let tests/compile-fail/length_expr_parentheses.rs pass.

Console output (before this patch is applied):

test tests/compile-fail/length_expr_parentheses.rs [should fail to compile] ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: this file contains an unclosed delimiter
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^ unclosed delimiter
   |
   = note: this error originates in the derive macro `::pnet_macros::Packet` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: this file contains an unclosed delimiter
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^ unclosed delimiter
   |
   = note: this error originates in the derive macro `::pnet_macros::Packet` (in Nightly builds, run with -Z macro-backtrace for more info)

error: proc-macro derive panicked
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^
   |
   = help: message: compiler/fallback mismatch
   = note: this error originates in the attribute macro `packet` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite

Fix "irrefutable while let pattern" warning

warning: irrefutable `while let` pattern
  --> examples/arp_packet.rs:61:11
   |
61 |     while let buf = receiver.next().unwrap() {
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this pattern will always match, so the loop will never exit
   = help: consider instead using a `loop { ... }` with a `let` inside it
   = note: `#[warn(irrefutable_let_patterns)]` on by default

vvv added 2 commits July 2, 2023 15:02
Let `tests/compile-fail/length_expr_parentheses.rs` pass.

Console output:

```
test tests/compile-fail/length_expr_parentheses.rs [should fail to compile] ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: this file contains an unclosed delimiter
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^ unclosed delimiter
   |
   = note: this error originates in the derive macro `::pnet_macros::Packet` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error: this file contains an unclosed delimiter
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^ unclosed delimiter
   |
   = note: this error originates in the derive macro `::pnet_macros::Packet` (in Nightly builds, run with -Z macro-backtrace for more info)

error: proc-macro derive panicked
  --> tests/compile-fail/length_expr_parentheses.rs:15:1
   |
15 | #[packet]
   | ^^^^^^^^^
   |
   = help: message: compiler/fallback mismatch
   = note: this error originates in the attribute macro `packet` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite
```
```
warning: irrefutable `while let` pattern
  --> examples/arp_packet.rs:61:11
   |
61 |     while let buf = receiver.next().unwrap() {
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this pattern will always match, so the loop will never exit
   = help: consider instead using a `loop { ... }` with a `let` inside it
   = note: `#[warn(irrefutable_let_patterns)]` on by default
```
@mrmonday mrmonday merged commit 12636de into libpnet:master Jul 19, 2023
@mrmonday
Copy link
Copy Markdown
Contributor

Looks good, thanks!

@vvv vvv deleted the spell-check branch July 20, 2023 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants