File tree 3 files changed +6
-7
lines changed 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ mysql_async = ["dep:mysql_async"]
19
19
[dependencies ]
20
20
async-trait = " 0.1"
21
21
cfg-if = " 1.0"
22
- lazy_static = " 1"
23
22
log = " 0.4"
23
+ once_cell = " 1"
24
24
regex = " 1"
25
25
serde = { version = " 1" , features = [" derive" ] }
26
26
siphasher = " 1.0"
Original file line number Diff line number Diff line change
1
+ use once_cell:: sync:: Lazy ;
1
2
use regex:: Regex ;
2
3
use siphasher:: sip:: SipHasher13 ;
3
4
use time:: OffsetDateTime ;
@@ -16,9 +17,7 @@ pub fn file_match_re() -> Regex {
16
17
Regex :: new ( r"^([U|V])(\d+(?:\.\d+)?)__(\w+)" ) . unwrap ( )
17
18
}
18
19
19
- lazy_static:: lazy_static! {
20
- static ref RE : regex:: Regex = file_match_re( ) ;
21
- }
20
+ pub ( crate ) static RE : Lazy < regex:: Regex > = Lazy :: new ( file_match_re) ;
22
21
23
22
/// An enum set that represents the type of the Migration
24
23
#[ derive( Clone , PartialEq ) ]
Original file line number Diff line number Diff line change 1
1
use crate :: error:: { Error , Kind } ;
2
+ use once_cell:: sync:: Lazy ;
2
3
use regex:: Regex ;
3
4
use std:: ffi:: OsStr ;
4
5
use std:: path:: { Path , PathBuf } ;
5
6
use walkdir:: { DirEntry , WalkDir } ;
6
7
7
- lazy_static:: lazy_static! {
8
- static ref RE : regex:: Regex = Regex :: new( r"^(U|V)(\d+(?:\.\d+)?)__\w+\.(rs|sql)$" ) . unwrap( ) ;
9
- }
8
+ pub ( crate ) static RE : Lazy < regex:: Regex > =
9
+ Lazy :: new ( || Regex :: new ( r"^(U|V)(\d+(?:\.\d+)?)__\w+\.(rs|sql)$" ) . unwrap ( ) ) ;
10
10
11
11
/// enum containing the migration types used to search for migrations
12
12
/// either just .sql files or both .sql and .rs
You can’t perform that action at this time.
0 commit comments