# HG changeset patch # User Antoine Cezar # Date 2020-08-17 08:59:30 # Node ID 3d9f1dfc52c2771b87bac7d0e734b4f73643416e # Parent a6a000ab135b6ebac3aa557b5aebf452e08b3807 hg-core: fix some `clippy` warnings Differential Revision: https://phab.mercurial-scm.org/D8957 diff --git a/rust/hg-core/src/operations/find_root.rs b/rust/hg-core/src/operations/find_root.rs --- a/rust/hg-core/src/operations/find_root.rs +++ b/rust/hg-core/src/operations/find_root.rs @@ -56,10 +56,10 @@ impl<'a> FindRoot<'a> { }; if current_dir.join(".hg").exists() { - return Ok(current_dir.into()); + return Ok(current_dir); } - let mut ancestors = current_dir.ancestors(); - while let Some(parent) = ancestors.next() { + let ancestors = current_dir.ancestors(); + for parent in ancestors { if parent.join(".hg").exists() { return Ok(parent.into()); }