This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Expand file tree Collapse file tree 3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -1743,9 +1743,8 @@ dependencies = [
17431743 " fs-err" ,
17441744 " getopts" ,
17451745 " jsonpath_lib" ,
1746- " lazy_static " ,
1746+ " once_cell " ,
17471747 " regex" ,
1748- " serde" ,
17491748 " serde_json" ,
17501749 " shlex" ,
17511750]
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"
1211shlex = " 1.0"
13- serde = " 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