/// When backtracking it can be useful to know how far back to go.
/// The `ContextAge` of a `Context` is a monotonically increasing counter of the number
/// of decisions made to get to this state.
-/// Several structures store the `ContextAge` when it was added, this lets use jump back.
+/// Several structures store the `ContextAge` when it was added, that gets use in jump back.
pub type ContextAge = usize;
-/// find the activated version of a crate based on the name, source, and semver compatibility
+/// Find the activated version of a crate based on the name, source, and semver compatibility.
+/// By storing this in a hash map we ensure that there is only one
+/// semver compatible version of each crate.
/// This all so stores the `ContextAge`.
pub type Activations =
im_rc::HashMap<(InternedString, SourceId, SemverCompatibility), (Summary, ContextAge)>;
/// Checks whether all of `parent` and the keys of `conflicting activations`
/// are still active.
- /// If so returns the "age" (len of activations) when the newest one was added.
+ /// If so returns the `ContextAge` when the newest one was added.
pub fn is_conflicting(
&self,
parent: Option<PackageId>,
if conflicting_activations.is_empty() {
return None;
}
- // We need to determine the "age" that this `conflicting_activations` will jump to, and why.
+ // We need to determine the `ContextAge` that this `conflicting_activations` will jump to, and why.
let (jumpback_critical_age, jumpback_critical_id) = conflicting_activations
.keys()
.map(|&c| (cx.is_active(c).expect("not currently active!?"), c))