cholcombe973 / block-utils

Rust utilities for working with block devices
MIT License
22 stars 17 forks source link

Don't error on unrecognised vendor string, and capture exact value #37

Closed richardstephens closed 1 year ago

richardstephens commented 1 year ago

When testing this, get_scsi_info() returns a StrumParseError(VariantNotFound) in the vendor field. I have an external hard drive attached which reports the string Seagate.

Another external drive I have reports the vendor string Samsung, so the set of enum variants is potentially unbounded.

An alternative approach would be to introduce an enum variant for Unrecognised that captures the actual value.

cholcombe973 commented 1 year ago

Yeah I think this is a great idea.