ifconfig run-and-check boilerplate repeated four times #10
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
carvers/silta#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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, andconfigured_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.