fix recursive device_path algorithm
This commit is contained in:
parent
9f26c8f50d
commit
11c0ef4db8
2 changed files with 22 additions and 20 deletions
|
@ -9,9 +9,7 @@ fn recurse_device_path(
|
||||||
mut uuid: Option<u128>,
|
mut uuid: Option<u128>,
|
||||||
mut path: Option<String>,
|
mut path: Option<String>,
|
||||||
) -> (Option<u128>, Option<String>) {
|
) -> (Option<u128>, Option<String>) {
|
||||||
match a.next {
|
match dbg!(&a.info) {
|
||||||
Some(next) => {
|
|
||||||
match &next.info {
|
|
||||||
DevicePathInfo::HardDrive {
|
DevicePathInfo::HardDrive {
|
||||||
partition_signature,
|
partition_signature,
|
||||||
signature_type,
|
signature_type,
|
||||||
|
@ -31,6 +29,9 @@ fn recurse_device_path(
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
match a.next {
|
||||||
|
Some(next) => {
|
||||||
return recurse_device_path(*next, uuid, path);
|
return recurse_device_path(*next, uuid, path);
|
||||||
}
|
}
|
||||||
None => return (uuid, path),
|
None => return (uuid, path),
|
||||||
|
|
|
@ -122,6 +122,7 @@ fn main() -> eyre::Result<()> {
|
||||||
&& let Some(device_path) = device_path
|
&& let Some(device_path) = device_path
|
||||||
{
|
{
|
||||||
let (uuid, path) = traverse_device_path(device_path);
|
let (uuid, path) = traverse_device_path(device_path);
|
||||||
|
eprintln!("devicepath uuid: {uuid:?}, path: {path:?}");
|
||||||
|
|
||||||
let windows_path_str = if let Some(windows_path_str) = path {
|
let windows_path_str = if let Some(windows_path_str) = path {
|
||||||
windows_path_str
|
windows_path_str
|
||||||
|
|
Loading…
Reference in a new issue