Patchwork [2,of,3] rust-filepatterns: silence warning of non_upper_case_globals

login
register
mail settings
Submitter Yuya Nishihara
Date June 15, 2019, 2:12 a.m.
Message ID <16042509c267e1e00fc5.1560564776@mimosa>
Download mbox | patch
Permalink /patch/40529/
State Accepted
Headers show

Comments

Yuya Nishihara - June 15, 2019, 2:12 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1560562553 -32400
#      Sat Jun 15 10:35:53 2019 +0900
# Node ID 16042509c267e1e00fc59f85166a1a6ae75a3bcc
# Parent  1e87fad0e1c119b7d2d88f09e9823581cd69dbb8
rust-filepatterns: silence warning of non_upper_case_globals

Patch

diff --git a/rust/hg-core/src/filepatterns.rs b/rust/hg-core/src/filepatterns.rs
--- a/rust/hg-core/src/filepatterns.rs
+++ b/rust/hg-core/src/filepatterns.rs
@@ -8,7 +8,7 @@  use utils::files::get_path_from_bytes;
 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 @@  fn glob_to_re(pat: &[u8]) -> Vec<u8> {
                         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 glob_to_re(pat: &[u8]) -> Vec<u8> {
 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()
 }