diff --git a/src/depcheck.rs b/src/depcheck.rs index 4726548..94bec8a 100644 --- a/src/depcheck.rs +++ b/src/depcheck.rs @@ -15,6 +15,18 @@ pub struct Dependency { pub filename: String, } +impl Ord for Dependency { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.name.cmp(&other.name) + } +} + +impl PartialOrd for Dependency { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} + #[derive(Debug, Clone, PartialEq, Eq)] pub struct DependencyCheckResult { pub dependency: Dependency, diff --git a/src/ui/app.rs b/src/ui/app.rs index 49e628c..36ef40c 100644 --- a/src/ui/app.rs +++ b/src/ui/app.rs @@ -273,6 +273,8 @@ impl SimpleComponent for App { } runners.push(get_build_opencomposite_runner(profile.clone())); if !missing_deps.is_empty() { + missing_deps.sort_unstable(); + missing_deps.dedup(); // dedup only works if sorted, hence the above self.dependencies_dialog.set_body( missing_deps .iter() @@ -462,7 +464,7 @@ impl SimpleComponent for App { .sender() .emit(MainViewMsg::UpdateProfileNames( model.profiles.iter().map(|p| p.clone().name).collect(), - model.config.clone() + model.config.clone(), )); let timer_sender = sender.clone();