File tree 3 files changed +11
-19
lines changed
3 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -1753,11 +1753,10 @@ dependencies = [
1753
1753
" fs-err" ,
1754
1754
" getopts" ,
1755
1755
" jsonpath_lib" ,
1756
- " lazy_static " ,
1756
+ " once_cell " ,
1757
1757
" regex" ,
1758
- " serde" ,
1759
1758
" serde_json" ,
1760
- " shlex 0.1.1 " ,
1759
+ " shlex" ,
1761
1760
]
1762
1761
1763
1762
[[package ]]
@@ -2138,7 +2137,7 @@ dependencies = [
2138
2137
" serde" ,
2139
2138
" serde_derive" ,
2140
2139
" serde_json" ,
2141
- " shlex 1.0.0 " ,
2140
+ " shlex" ,
2142
2141
" tempfile" ,
2143
2142
" toml" ,
2144
2143
]
@@ -4813,12 +4812,6 @@ version = "0.1.5"
4813
4812
source = " registry+https://github.com/rust-lang/crates.io-index"
4814
4813
checksum = " 45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f"
4815
4814
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
-
4822
4815
[[package ]]
4823
4816
name = " shlex"
4824
4817
version = " 1.0.0"
Original file line number Diff line number Diff line change @@ -8,8 +8,7 @@ edition = "2018"
8
8
jsonpath_lib = " 0.2"
9
9
getopts = " 0.2"
10
10
regex = " 1.4"
11
- lazy_static = " 1.4"
12
- shlex = " 0.1"
13
- serde = " 1.0"
11
+ shlex = " 1.0"
14
12
serde_json = " 1.0"
15
13
fs-err = " 2.5.0"
14
+ once_cell = " 1.0"
Original file line number Diff line number Diff line change 1
1
use jsonpath_lib:: select;
2
- use lazy_static :: lazy_static ;
2
+ use once_cell :: sync :: Lazy ;
3
3
use regex:: { Regex , RegexBuilder } ;
4
4
use serde_json:: Value ;
5
5
use std:: borrow:: Cow ;
@@ -94,19 +94,19 @@ impl fmt::Display for CommandKind {
94
94
}
95
95
}
96
96
97
- lazy_static ! {
98
- static ref LINE_PATTERN : Regex = RegexBuilder :: new(
97
+ static LINE_PATTERN : Lazy < Regex > = Lazy :: new ( || {
98
+ RegexBuilder :: new (
99
99
r#"
100
100
\s(?P<invalid>!?)@(?P<negated>!?)
101
101
(?P<cmd>[A-Za-z]+(?:-[A-Za-z]+)*)
102
102
(?P<args>.*)$
103
- "#
103
+ "# ,
104
104
)
105
105
. ignore_whitespace ( true )
106
106
. unicode ( true )
107
107
. build ( )
108
- . unwrap( ) ;
109
- }
108
+ . unwrap ( )
109
+ } ) ;
110
110
111
111
fn print_err ( msg : & str , lineno : usize ) {
112
112
eprintln ! ( "Invalid command: {} on line {}" , msg, lineno)
You can’t perform that action at this time.
0 commit comments