diff --git a/docs/superpowers/specs/2026-03-25-remove-rusb-backend-design.md b/docs/superpowers/specs/2026-03-25-remove-rusb-backend-design.md index eb1dd93..63aa238 100644 --- a/docs/superpowers/specs/2026-03-25-remove-rusb-backend-design.md +++ b/docs/superpowers/specs/2026-03-25-remove-rusb-backend-design.md @@ -18,11 +18,31 @@ Remove the entire directory containing `cdc_acm_serial.rs`, `hid_keyboard.rs`, a - Delete the `rusb = "0.9.3"` dependency - Fix the `serde` feature from `["dep:serde", "rusb/serde"]` to `["dep:serde"]` -### 3. Remove rusb types from `lib/src/host.rs` +### 3. Replace `pub use rusb::Direction` in `lib/src/consts.rs` + +Replace `pub use rusb::Direction;` with a locally-defined enum preserving the USB endpoint address direction bit values: + +```rust +/// USB endpoint direction +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum Direction { + Out = 0x00, + In = 0x80, +} +``` + +### 4. Remove rusb `Version` conversions from `lib/src/device.rs` + +- Remove `use rusb::Version as rusbVersion;` +- Delete the `From for Version` and `From for rusbVersion` impl blocks + +These are only used by the rusb enumeration path being deleted. + +### 5. Remove rusb types from `lib/src/host.rs` Delete `RusbUsbHostInterfaceHandler` (struct + `UsbInterfaceHandler` impl) and `RusbUsbHostDeviceHandler` (struct + `UsbDeviceHandler` impl). Keep `nusb_speed_to_linux()` and both `NusbUsbHost*Handler` types unchanged. -### 4. Replace rusb enumeration in `lib/src/lib.rs` +### 6. Replace rusb enumeration in `lib/src/lib.rs` - Remove `use rusb::*` - Delete `with_rusb_device_handles()` and `with_rusb_devices()` @@ -52,7 +72,11 @@ where The filter type changes from `FnMut(&rusb::Device)` to `FnMut(&nusb::DeviceInfo)`. -### 5. Verification +### 7. Update stale comment in `lib/src/usbip_protocol.rs` + +Update the comment on line 49 ("Must not be confused with rusb::Direction") to reference the local `Direction` enum in `consts.rs` instead. + +### 8. Verification - `cargo build` succeeds - `cargo test` passes