diff --git a/src/cell.rs b/src/cell.rs index 7d84baa..e6dde73 100755 --- a/src/cell.rs +++ b/src/cell.rs @@ -212,8 +212,13 @@ impl Cell { #[inline] pub fn is_related_to(&self, other: &Self) -> bool { let common_res = std::cmp::min(self.res(), other.res()); - // Unwrap is fine. We already checked to the min common resolution. - self.to_parent(common_res).unwrap() == other.to_parent(common_res).unwrap() + let promoted_self = self + .to_parent(common_res) + .expect("we already checked to the min common resolution"); + let promoted_other = other + .to_parent(common_res) + .expect("we already checked to the min common resolution"); + promoted_self == promoted_other } } diff --git a/src/entry.rs b/src/entry.rs index 85a1ddc..33779c7 100644 --- a/src/entry.rs +++ b/src/entry.rs @@ -176,8 +176,7 @@ where }) => cell_value, Entry::Vacant(VacantEntry { target_cell, map }) => { map.insert(target_cell, Default::default()); - // We just inserted; unwrap is fine. - map.get_mut(target_cell).unwrap() + map.get_mut(target_cell).expect("we just inserted") } } }