diff --git a/src/rasqal/src/analysis/solver.rs b/src/rasqal/src/analysis/solver.rs index 0f9dd0e..49b86d5 100644 --- a/src/rasqal/src/analysis/solver.rs +++ b/src/rasqal/src/analysis/solver.rs @@ -206,15 +206,13 @@ impl AnalysisQubit { pub fn is_entangled(&self) -> bool { !self.tangles.is_empty() } - // TODO: Remove self_pointer and decide how to deal with this. Don't want to steal the - // borrow really. - pub fn entangle(&self, self_pointer: &Ptr, other: &Ptr) { + pub fn entangle(&self, other: &Ptr) { if self.is_entangled_with(&other.index) { return; } - let tangle = Ptr::from(Tangle::from_qubits(self_pointer, other)); - with_mutable!(self_pointer.tangles.insert(other.index, tangle.clone())); + let tangle = Ptr::from(Tangle::from_qubits(&Ptr::from(self), other)); + with_mutable_self!(self.tangles.insert(other.index, tangle.clone())); with_mutable!(other.tangles.insert(self.index, tangle)); }