File tree Expand file tree Collapse file tree 3 files changed +13
-16
lines changed
Expand file tree Collapse file tree 3 files changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -21,4 +21,3 @@ trait-variant = "0.1.2"
2121async-trait = " 0.1.43"
2222async-stream = " 0.3.1"
2323strum = " 0.26.1"
24- lazy_static = " 1"
Original file line number Diff line number Diff line change 11#![ allow( dead_code) ]
22
3- use std:: sync:: atomic:: AtomicUsize ;
3+ use std:: { cell :: LazyCell , sync:: atomic:: AtomicUsize } ;
44
55use sea_orm:: * ;
66use sea_orm_migration:: prelude:: * ;
@@ -17,19 +17,18 @@ pub const DATABASE_FILENAME: &str = "sqlite.db";
1717pub const DATABASE_URL : & str = "sqlite:./sqlite.db?mode=rwc" ;
1818
1919pub const TEST_DATABASE_FILENAME : & str = "init.db" ;
20- lazy_static:: lazy_static! {
21- pub static ref TEST_DATABASE_FILE : String = {
22- std:: env:: current_dir( ) . unwrap( )
23- . join( "src" )
24- . join( "db" )
25- . join( TEST_DATABASE_FILENAME )
26- . to_str( )
27- . unwrap( )
28- . to_owned( )
29- } ;
30- pub static ref TEST_DATABASE_URL : String =
31- get_sqlite_url( TEST_DATABASE_FILE . as_str( ) ) ;
32- }
20+ pub const TEST_DATABASE_FILE : LazyCell < String > = LazyCell :: new ( || {
21+ std:: env:: current_dir ( )
22+ . unwrap ( )
23+ . join ( "src" )
24+ . join ( "db" )
25+ . join ( TEST_DATABASE_FILENAME )
26+ . to_str ( )
27+ . unwrap ( )
28+ . to_owned ( )
29+ } ) ;
30+ pub const TEST_DATABASE_URL : LazyCell < String > =
31+ LazyCell :: new ( || get_sqlite_url ( TEST_DATABASE_FILE . as_str ( ) ) ) ;
3332
3433fn get_sqlite_url ( file : & str ) -> String {
3534 format ! ( "sqlite:{}?mode=rwc" , file)
You can’t perform that action at this time.
0 commit comments