Skip to content

Commit

Permalink
Fix versions and better warning re: MacOS mishaps
Browse files Browse the repository at this point in the history
  • Loading branch information
kimono-koans committed Aug 5, 2024
1 parent bea1653 commit d645a29
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/data/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ pub const PHANTOM_PATH_METADATA: PathMetadata = PathMetadata {

#[derive(Eq, PartialEq)]
pub struct CompareVersionsContainer {
pathdata: PathData,
pub pathdata: PathData,
opt_hash: Option<OnceLock<u64>>,
}

Expand Down
17 changes: 9 additions & 8 deletions src/lookup/versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::data::paths::PathMetadata;
use crate::data::paths::{CompareVersionsContainer, PathData};
use crate::library::results::{HttmError, HttmResult};
use crate::GLOBAL_CONFIG;
use std::collections::{BTreeMap, BTreeSet};
use std::collections::BTreeMap;
use std::io::ErrorKind;
use std::ops::{Deref, DerefMut};
use std::path::{Path, PathBuf};
Expand Down Expand Up @@ -61,12 +61,9 @@ impl VersionsMap {
.par_iter()
.filter_map(|pathdata| match Versions::new(pathdata, config) {
Ok(versions) => Some(versions),
Err(_err) => {
Err(err) => {
if !is_interactive_mode {
eprintln!(
"WARN: Filesystem upon which the path resides is not supported: {:?}\n",
pathdata.path_buf
)
eprintln!("WARN: {:?}\n", err)
}
None
}
Expand Down Expand Up @@ -355,10 +352,14 @@ impl<'a> RelativePathAndSnapMounts<'a> {
vec
}
ListSnapsOfType::UniqueContents | ListSnapsOfType::UniqueMetadata => {
let sorted_and_deduped: BTreeSet<CompareVersionsContainer> = iter
let mut vec: Vec<CompareVersionsContainer> = iter
.map(|pd| CompareVersionsContainer::new(pd, uniqueness))
.collect();
sorted_and_deduped.into_iter().map(PathData::from).collect()

vec.sort_unstable_by_key(|path| path.pathdata.md_infallible().modify_time);
vec.dedup_by(|a, b| a.cmp(&b) == std::cmp::Ordering::Equal);

vec.into_iter().map(PathData::from).collect()
}
}
}
Expand Down

0 comments on commit d645a29

Please sign in to comment.