summaryrefslogtreecommitdiffstats
path: root/src/git/ignore.rs
diff options
context:
space:
mode:
authorCanop <cano.petrole@gmail.com>2021-06-02 13:45:12 +0200
committerCanop <cano.petrole@gmail.com>2021-06-02 13:45:12 +0200
commit77f40f74c38392a5213f99006138d74772ac5c6c (patch)
tree145732e2e45e0dd3bf17e2a2f3e07027cc5d3338 /src/git/ignore.rs
parent7635373786d1c0fbc45c326d4a0a8914396f7051 (diff)
make the number of threads used for file summing configurable
Also replace lazy_static with once_cell
Diffstat (limited to 'src/git/ignore.rs')
-rw-r--r--src/git/ignore.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/git/ignore.rs b/src/git/ignore.rs
index f3f267e..4c6558e 100644
--- a/src/git/ignore.rs
+++ b/src/git/ignore.rs
@@ -4,8 +4,8 @@ use {
git2,
glob,
id_arena::{Arena, Id},
- lazy_static::lazy_static,
lazy_regex::regex,
+ once_cell::sync::Lazy,
std::{
fs::File,
io::{BufRead, BufReader, Result},
@@ -97,9 +97,7 @@ impl GitIgnoreFile {
/// return the global gitignore file interpreted for
/// the given repo dir
pub fn global(repo_dir: &Path) -> Option<GitIgnoreFile> {
- lazy_static! {
- static ref GLOBAL_GI_PATH: Option<PathBuf> = find_global_ignore();
- }
+ static GLOBAL_GI_PATH: Lazy<Option<PathBuf>> = Lazy::new(find_global_ignore);
if let Some(path) = &*GLOBAL_GI_PATH {
GitIgnoreFile::new(path, repo_dir).ok()
} else {