ifconfig run-and-check boilerplate repeated four times #10

Closed
opened 2026-08-11 10:25:50 +00:00 by aav · 0 comments
Owner

Four functions hand-roll the same Command::new("ifconfig")...output() + status-check boilerplate (src/platform/macos.rs lines 14, 29, 51, 88): ifconfig(), interface_exists, all_addresses, and configured_addresses.

Failure scenario: copy-paste with slight variation. An improvement to error reporting (e.g. including stderr) must be made four times.

Fix direction: one ifconfig_output(args) -> Result<String> helper collapses three of the four.

Source: high-effort code review, CONFIRMED. Area: platform/macos.

Four functions hand-roll the same `Command::new("ifconfig")...output()` + status-check boilerplate (src/platform/macos.rs lines 14, 29, 51, 88): `ifconfig()`, `interface_exists`, `all_addresses`, and `configured_addresses`. **Failure scenario:** copy-paste with slight variation. An improvement to error reporting (e.g. including stderr) must be made four times. **Fix direction:** one `ifconfig_output(args) -> Result<String>` helper collapses three of the four. Source: high-effort code review, CONFIRMED. Area: platform/macos.
aav self-assigned this 2026-08-11 10:27:24 +00:00
aav closed this issue 2026-08-11 11:03:15 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
carvers/silta#10
No description provided.