Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kimono-koans committed Jan 3, 2024
1 parent 2dfa3bc commit e2d4dcd
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions src/lookup/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,27 +184,18 @@ impl<'a> ProximateDatasetAndOptAlts<'a> {
.alias_dataset()
.map_or_else(|| pathdata.proximate_dataset(), Ok)?;

let res: Self = match GLOBAL_CONFIG
let opt_alts = GLOBAL_CONFIG
.dataset_collection
.opt_map_of_alts
.as_ref()
.and_then(|map_of_alts| map_of_alts.get(proximate_dataset_mount))
.and_then(|alt_metadata| alt_metadata.opt_datasets_of_interest.as_ref())
{
Some(datasets_of_interest) => Self {
pathdata,
proximate_dataset_mount,
opt_alts: Some(datasets_of_interest),
},

None => Self {
pathdata,
proximate_dataset_mount,
opt_alts: None,
},
};

Ok(res)
.and_then(|alt_metadata| alt_metadata.opt_datasets_of_interest.as_ref());

Ok(Self {
pathdata,
proximate_dataset_mount,
opt_alts,
})
}

pub fn datasets_of_interest(&'a self) -> impl Iterator<Item = &'a Path> {
Expand Down

0 comments on commit e2d4dcd

Please sign in to comment.