changeset 42483:a4a468b00d44

rust-filepatterns: silence warning of non_upper_case_globals
author Yuya Nishihara <yuya@tcha.org>
date Sat, 15 Jun 2019 10:35:53 +0900
parents cc4db4478467
children f305f1d7d559
files rust/hg-core/src/filepatterns.rs
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/filepatterns.rs	Sat Jun 15 10:35:03 2019 +0900
+++ b/rust/hg-core/src/filepatterns.rs	Sat Jun 15 10:35:53 2019 +0900
@@ -8,7 +8,7 @@
 use utils::{replace_slice, SliceExt};
 
 lazy_static! {
-    static ref reescape: Vec<Vec<u8>> = {
+    static ref RE_ESCAPE: Vec<Vec<u8>> = {
         let mut v: Vec<Vec<u8>> = (0..=255).map(|byte| vec![byte]).collect();
         let to_escape = b"()[]{}?*+-|^$\\.&~# \t\n\r\x0b\x0c";
         for byte in to_escape {
@@ -99,9 +99,9 @@
                         c
                     }
                 };
-                res.extend(&reescape[*c as usize])
+                res.extend(&RE_ESCAPE[*c as usize])
             }
-            _ => res.extend(&reescape[*c as usize]),
+            _ => res.extend(&RE_ESCAPE[*c as usize]),
         }
     }
     res
@@ -110,7 +110,7 @@
 fn escape_pattern(pattern: &[u8]) -> Vec<u8> {
     pattern
         .iter()
-        .flat_map(|c| reescape[*c as usize].clone())
+        .flat_map(|c| RE_ESCAPE[*c as usize].clone())
         .collect()
 }