File tree 3 files changed +8
-10
lines changed
3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -1743,9 +1743,8 @@ dependencies = [
1743
1743
" fs-err" ,
1744
1744
" getopts" ,
1745
1745
" jsonpath_lib" ,
1746
- " lazy_static " ,
1746
+ " once_cell " ,
1747
1747
" regex" ,
1748
- " serde" ,
1749
1748
" serde_json" ,
1750
1749
" shlex" ,
1751
1750
]
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
11
shlex = " 1.0"
13
- serde = " 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