changeset 45441:3d9f1dfc52c2

hg-core: fix some `clippy` warnings Differential Revision: https://phab.mercurial-scm.org/D8957
author Antoine Cezar <antoine.cezar@octobus.net>
date Mon, 17 Aug 2020 10:59:30 +0200
parents a6a000ab135b
children c6e332a451d0
files rust/hg-core/src/operations/find_root.rs
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/operations/find_root.rs	Mon Aug 17 16:55:43 2020 +0200
+++ b/rust/hg-core/src/operations/find_root.rs	Mon Aug 17 10:59:30 2020 +0200
@@ -56,10 +56,10 @@
         };
 
         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());
             }