From d8d52abd5bcdc8484c685a47e9842c0f015836f4 Mon Sep 17 00:00:00 2001 From: "Hatter Jiang@Pixelbook" Date: Sun, 2 Aug 2020 14:44:02 +0800 Subject: [PATCH] fix: add loop count --- src/util_file.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util_file.rs b/src/util_file.rs index 6a1cad6..60c228c 100644 --- a/src/util_file.rs +++ b/src/util_file.rs @@ -83,7 +83,7 @@ pub fn find_parents_exists_file(file: &str) -> Option { Err(_) => None, Ok(mut path) => loop { loop_count += 1; - if loop_count > 100 { panic!("Loop count more than 100!"); } + if loop_count > 1000 { panic!("Loop count more than 1000!"); } if path.join(file).is_file() { return Some(path); } @@ -100,7 +100,7 @@ pub fn find_parents_exists_dir(dir: &str) -> Option { Err(_) => None, Ok(mut path) => loop { loop_count += 1; - if loop_count > 100 { panic!("Loop count more than 100!"); } + if loop_count > 1000 { panic!("Loop count more than 1000!"); } if path.join(dir).is_dir() { return Some(path); }