Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kimono-koans committed Mar 20, 2024
1 parent bde1230 commit ac89b9b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/parse/mounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,18 @@ impl BaseFilesystemInfo {
.filter_map(|line| line.split_once('='))
.collect();

let subvol_id = match keyed_options.get("subvol") {
Some(subvol) => match keyed_options.get("subvolid") {
let opt_subvol = keyed_options.get("subvol").map(|subvol| {
match keyed_options.get("subvolid") {
Some(id) if *id == "5" => BTRFS_ROOT_SUBVOL.clone(),
_ => PathBuf::from(subvol),
},
None => PathBuf::from(&mount_info.source),
};
}
});

Either::Left((
dest_path,
DatasetMetadata {
source: mount_info.source,
fs_type: FilesystemType::Btrfs(Some(subvol_id)),
fs_type: FilesystemType::Btrfs(opt_subvol),
},
))
}
Expand Down

0 comments on commit ac89b9b

Please sign in to comment.