From 77eaa208ed2f423572fbeb8096f8c180d22c78fd Mon Sep 17 00:00:00 2001 From: gfreezy Date: Fri, 21 Dec 2018 22:30:41 +0800 Subject: rename to dfs_find --- crates/ra_db/src/input.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_db') diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index f220eda9e..f6d11844a 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs @@ -94,7 +94,7 @@ impl CrateGraph { crate_id } pub fn add_dep(&mut self, from: CrateId, name: SmolStr, to: CrateId) { - if self.dfs(from, to) { + if self.dfs_find(from, to) { panic!("Cycle dependencies found.") } self.arena.get_mut(&from).unwrap().add_dep(name, to) @@ -115,14 +115,14 @@ impl CrateGraph { ) -> impl Iterator + 'a { self.arena[&crate_id].dependencies.iter() } - fn dfs(&self, target: CrateId, from: CrateId) -> bool { + fn dfs_find(&self, target: CrateId, from: CrateId) -> bool { for dep in self.dependencies(from) { let crate_id = dep.crate_id(); if crate_id == target { return true; } if self.arena.contains_key(&crate_id) { - if self.dfs(target, crate_id) { + if self.dfs_find(target, crate_id) { return true; } } -- cgit v1.2.3