Просмотр исходного кода

Add a dummy SubdirGitRepo::from_path() implementation for
--no-default-features configuration

modified: src/fs/feature/mod.rs
modified: src/fs/fields.rs

alpn 5 лет назад
Родитель
Сommit
da3ce930f5
2 измененных файлов с 7 добавлено и 0 удалено
  1. 6 0
      src/fs/feature/mod.rs
  2. 1 0
      src/fs/fields.rs

+ 6 - 0
src/fs/feature/mod.rs

@@ -30,4 +30,10 @@ pub mod git {
             panic!("Tried to query a Git cache, but Git support is disabled")
         }
     }
+
+    impl f::SubdirGitRepo{
+        pub fn from_path(_dir : &Path) -> Self{
+            Self{status : f::SubdirGitRepoStatus::NotRepo}
+        }
+    }
 }

+ 1 - 0
src/fs/fields.rs

@@ -247,6 +247,7 @@ impl Default for Git {
 }
 
 #[derive(PartialEq, Copy, Clone)]
+#[allow(dead_code)]
 pub enum SubdirGitRepoStatus{
     NotDir,
     NotRepo,