refactor: extract net tool handlers into named functions - #64
Merged
Conversation
Signed-off-by: danbugs <danilochiarlone@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR refactors network tool registration by extracting inline net_* handler closures into named functions, making the host networking dispatch logic easier to audit and test without changing behavior.
Changes:
- Adds named
handle_net_*functions for all network tool operations. - Simplifies
register_net_toolsto register one-line delegating closures. - Preserves existing socket table, policy, and listen-port handling semantics.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Linux Benchmarks
Details
| Benchmark suite | Current: 3f34c27 | Previous: 2c92788 | Ratio |
|---|---|---|---|
hello_world (median) |
20 ms |
20 ms |
1 |
pandas (median) |
110 ms |
110 ms |
1 |
density (per VM) |
7 MB |
7 MB |
1 |
snapshot (disk) |
385 MiB |
385 MiB |
1 |
This comment was automatically generated by workflow using github-action-benchmark.
Contributor
There was a problem hiding this comment.
Windows Benchmarks
Details
| Benchmark suite | Current: 3f34c27 | Previous: 2c92788 | Ratio |
|---|---|---|---|
hello_world (median) |
251 ms |
187 ms |
1.34 |
pandas (median) |
758 ms |
545 ms |
1.39 |
density (per VM) |
6 MB |
6 MB |
1 |
snapshot (disk) |
392 MiB |
392 MiB |
1 |
This comment was automatically generated by workflow using github-action-benchmark.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
register_net_toolsinto namedhandle_net_*functionsregister_net_toolsis now a thin registration function where each closure is a one-liner delegating to the named handlerTest plan
cargo test --libpasses (53 tests — same count as before)cargo clippycleancargo fmtclean