[T]::position_elem is deprecated.

This commit is contained in:
Simon Sapin 2015-08-04 17:34:39 +02:00
parent 1d47857be9
commit b2ee828520
2 changed files with 1 additions and 2 deletions

View file

@ -196,7 +196,7 @@ fn remove_cycles(map: &mut HashMap<&Atom, BorrowedValue>) {
if let Some(references) = value.references {
stack.push(name);
for next in references {
if let Some(position) = stack.position_elem(&next) {
if let Some(position) = stack.iter().position(|&x| x == next) {
// Found a cycle
for &in_cycle in &stack[position..] {
to_remove.insert(in_cycle.clone());