From 94ac4a442a67019598af1289653a82cdb9278e95 Mon Sep 17 00:00:00 2001 From: MattJackson Date: Tue, 28 Jul 2026 11:41:49 -0700 Subject: [PATCH] drive: promote extract_scsi_context to pub Small pure error->(status,sense) introspection helper the relocated sweep/patch will need externally. Same category as the prior WritebackFile/ resolve_content_key_map promotions -- infra, not policy. No behavior change. --- src/drive/mod.rs | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drive/mod.rs b/src/drive/mod.rs index 76a1c5c..ed64da5 100644 --- a/src/drive/mod.rs +++ b/src/drive/mod.rs @@ -4,7 +4,7 @@ //! optionally unlocks/initializes via the `freemkv-unlock` dispatch //! (through [`crate::unlock_bridge`]), and reads sectors. -pub(crate) fn extract_scsi_context(e: &Error) -> (u8, Option) { +pub fn extract_scsi_context(e: &Error) -> (u8, Option) { match e { Error::ScsiError { status, sense, .. } => (*status, *sense), Error::DiscRead { status, sense, .. } => (status.unwrap_or(0), *sense), diff --git a/src/lib.rs b/src/lib.rs index df7a8b3..c6d5237 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -138,7 +138,7 @@ pub(crate) mod unlock_bridge; pub use drive::capture::{ CapturedFeature, DriveCapture, capture_drive_data, mask_bytes, mask_string, }; -pub use drive::{Drive, DriveStatus, find_drive}; +pub use drive::{Drive, DriveStatus, extract_scsi_context, find_drive}; // ─── Disc session (drive open + SCSI bring-up hoist) ───────────────────────── //