Skip to content

Split disk code into per-OS modules - #81

Open
justanotherariel wants to merge 4 commits into
justanotherariel-udisks2from
justanotherariel-disk-split
Open

Split disk code into per-OS modules#81
justanotherariel wants to merge 4 commits into
justanotherariel-udisks2from
justanotherariel-disk-split

Conversation

@justanotherariel

@justanotherariel justanotherariel commented Sep 3, 2026

Copy link
Copy Markdown
Member

Description

Pure code motion, stacked on #14 — review with git diff --color-moved.

  • The inline mod macos/linux/windows blocks in devices.rs and disk_writer.rs move to per-OS files, imported as a single mod imp via #[path], so dispatch is one imp:: call instead of one cfg block per function.
  • Platform-specific tests move next to the code they test.
  • Deletes filler tests (constant self-checks, is_ok() || is_err() tautologies).

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • CI/CD changes

Related Issues

Stacked on #14; base of #82 and #83.

Testing

  • Unit tests added/updated (moved with their code; filler removed)
  • E2E tests added/updated
  • Manually tested on macOS
  • Manually tested on Windows
  • Manually tested on Linux

cargo test -p hai-core --features mock passes on Linux; the moved tests run identically under their new module paths.

Screenshots

N/A — no UI changes.

Checklist

  • My code follows the project's code style
  • I have run cargo fmt and npm run lint
  • I have added tests for my changes
  • All new and existing tests pass
  • I have updated documentation if needed
  • My commits follow conventional commit format

DO NOT MERGE. After reviewing, merge #14 to merge all directly

justanotherariel and others added 4 commits September 2, 2026 22:49
Move the inline mod macos/linux/windows blocks into
devices/{macos,linux,windows}.rs and disk_writer/{macos,linux,windows}.rs,
each carrying its own platform tests. The parent files keep the public
API, the cfg dispatch, the shared safety checks (validate_device_path,
is_drive_disconnected) and the cross-platform tests. Pure code motion,
no behavior change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant