summaryrefslogtreecommitdiffstats
path: root/vendor/mdbook/src/preprocess/index.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/mdbook/src/preprocess/index.rs')
-rw-r--r--vendor/mdbook/src/preprocess/index.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/vendor/mdbook/src/preprocess/index.rs b/vendor/mdbook/src/preprocess/index.rs
index fd60ad4da..004b7eda6 100644
--- a/vendor/mdbook/src/preprocess/index.rs
+++ b/vendor/mdbook/src/preprocess/index.rs
@@ -1,10 +1,11 @@
use regex::Regex;
use std::path::Path;
-use crate::errors::*;
-
use super::{Preprocessor, PreprocessorContext};
use crate::book::{Book, BookItem};
+use crate::errors::*;
+use log::warn;
+use once_cell::sync::Lazy;
/// A preprocessor for converting file name `README.md` to `index.md` since
/// `README.md` is the de facto index file in markdown-based documentation.
@@ -67,9 +68,8 @@ fn warn_readme_name_conflict<P: AsRef<Path>>(readme_path: P, index_path: P) {
}
fn is_readme_file<P: AsRef<Path>>(path: P) -> bool {
- lazy_static! {
- static ref RE: Regex = Regex::new(r"(?i)^readme$").unwrap();
- }
+ static RE: Lazy<Regex> = Lazy::new(|| Regex::new(r"(?i)^readme$").unwrap());
+
RE.is_match(
path.as_ref()
.file_stem()