Skip to content

refactor: extract net tool handlers into named functions - #64

Merged
danbugs merged 1 commit into
mainfrom
refactor/split-net-handlers
May 17, 2026
Merged

refactor: extract net tool handlers into named functions#64
danbugs merged 1 commit into
mainfrom
refactor/split-net-handlers

Conversation

@danbugs

@danbugs danbugs commented May 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Extracts all 15 inline closures from register_net_tools into named handle_net_* functions
  • register_net_tools is now a thin registration function where each closure is a one-liner delegating to the named handler
  • Reduces the audit surface: each handler's logic is independently readable and testable
  • Pure refactor — no behavior change

Test plan

  • cargo test --lib passes (53 tests — same count as before)
  • cargo clippy clean
  • cargo fmt clean

Signed-off-by: danbugs <danilochiarlone@gmail.com>
Copilot AI review requested due to automatic review settings May 17, 2026 06:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_tools to 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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@danbugs
danbugs merged commit b69cdbf into main May 17, 2026
80 checks passed
@danbugs
danbugs deleted the refactor/split-net-handlers branch May 17, 2026 06:54
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