File tree Expand file tree Collapse file tree 3 files changed +11
-19
lines changed Expand file tree Collapse file tree 3 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -1753,11 +1753,10 @@ dependencies = [
17531753 " fs-err" ,
17541754 " getopts" ,
17551755 " jsonpath_lib" ,
1756- " lazy_static " ,
1756+ " once_cell " ,
17571757 " regex" ,
1758- " serde" ,
17591758 " serde_json" ,
1760- " shlex 0.1.1 " ,
1759+ " shlex" ,
17611760]
17621761
17631762[[package ]]
@@ -2138,7 +2137,7 @@ dependencies = [
21382137 " serde" ,
21392138 " serde_derive" ,
21402139 " serde_json" ,
2141- " shlex 1.0.0 " ,
2140+ " shlex" ,
21422141 " tempfile" ,
21432142 " toml" ,
21442143]
@@ -4813,12 +4812,6 @@ version = "0.1.5"
48134812source = " registry+https://github.com/rust-lang/crates.io-index"
48144813checksum = " 45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f"
48154814
4816- [[package ]]
4817- name = " shlex"
4818- version = " 0.1.1"
4819- source = " registry+https://github.com/rust-lang/crates.io-index"
4820- checksum = " 7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
4821-
48224815[[package ]]
48234816name = " shlex"
48244817version = " 1.0.0"
Original file line number Diff line number Diff line change @@ -8,8 +8,7 @@ edition = "2018"
88jsonpath_lib = " 0.2"
99getopts = " 0.2"
1010regex = " 1.4"
11- lazy_static = " 1.4"
12- shlex = " 0.1"
13- serde = " 1.0"
11+ shlex = " 1.0"
1412serde_json = " 1.0"
1513fs-err = " 2.5.0"
14+ once_cell = " 1.0"
Original file line number Diff line number Diff line change 11use jsonpath_lib:: select;
2- use lazy_static :: lazy_static ;
2+ use once_cell :: sync :: Lazy ;
33use regex:: { Regex , RegexBuilder } ;
44use serde_json:: Value ;
55use std:: borrow:: Cow ;
@@ -94,19 +94,19 @@ impl fmt::Display for CommandKind {
9494 }
9595}
9696
97- lazy_static ! {
98- static ref LINE_PATTERN : Regex = RegexBuilder :: new(
97+ static LINE_PATTERN : Lazy < Regex > = Lazy :: new ( || {
98+ RegexBuilder :: new (
9999 r#"
100100 \s(?P<invalid>!?)@(?P<negated>!?)
101101 (?P<cmd>[A-Za-z]+(?:-[A-Za-z]+)*)
102102 (?P<args>.*)$
103- "#
103+ "# ,
104104 )
105105 . ignore_whitespace ( true )
106106 . unicode ( true )
107107 . build ( )
108- . unwrap( ) ;
109- }
108+ . unwrap ( )
109+ } ) ;
110110
111111fn print_err ( msg : & str , lineno : usize ) {
112112 eprintln ! ( "Invalid command: {} on line {}" , msg, lineno)
You can’t perform that action at this time.
0 commit comments