@@ -137,7 +137,10 @@ pub(crate) fn ensure_system_modules(ctx: &AppContext) {
137137fn seed_system_module ( ctx : & AppContext , vault : & Vault , id : & str ) -> Result < ( ) > {
138138 let module = vault. modules . get ( id) . ok_or_else ( || anyhow:: anyhow!( "not in the registry" ) ) ?;
139139 let version = resolve_version ( module) ?;
140- let entry = module. v . get ( & version) . ok_or_else ( || anyhow:: anyhow!( "{version} is not in the registry" ) ) ?;
140+ let entry = module
141+ . v
142+ . get ( & version)
143+ . ok_or_else ( || anyhow:: anyhow!( "{version} is not in the registry" ) ) ?;
141144 if entry. artifacts . is_empty ( ) {
142145 anyhow:: bail!( "{id}@{version} has no artifact" ) ;
143146 }
@@ -243,8 +246,7 @@ mod tests {
243246 #[ test]
244247 #[ ignore = "hits the live registry and downloads artifacts" ]
245248 fn seed_live_installs_and_enables_system_modules ( ) {
246- let root =
247- std:: env:: temp_dir ( ) . join ( format ! ( "spicetify-seed-live-{}" , std:: process:: id( ) ) ) ;
249+ let root = std:: env:: temp_dir ( ) . join ( format ! ( "spicetify-seed-live-{}" , std:: process:: id( ) ) ) ;
248250 let _ = std:: fs:: remove_dir_all ( & root) ;
249251 std:: fs:: create_dir_all ( & root) . expect ( "temp config" ) ;
250252
@@ -260,10 +262,7 @@ mod tests {
260262 for id in SYSTEM_MODULES {
261263 let link = modules_root. join ( id) ;
262264 assert ! ( link. exists( ) , "{id} enabled and reachable through modules/" ) ;
263- assert ! (
264- link. join( "metadata.json" ) . is_file( ) ,
265- "{id} unpacked with its metadata"
266- ) ;
265+ assert ! ( link. join( "metadata.json" ) . is_file( ) , "{id} unpacked with its metadata" ) ;
267266 }
268267 assert ! ( missing_system_modules( & modules_root) . is_empty( ) , "nothing left to seed" ) ;
269268
@@ -276,10 +275,18 @@ mod tests {
276275 let _ = std:: fs:: remove_dir_all ( & dir) ;
277276 std:: fs:: create_dir_all ( & dir) . expect ( "temp dir" ) ;
278277
279- assert_eq ! ( missing_system_modules( & dir) , vec![ "stdlib" , "store" ] , "a fresh config needs both" ) ;
278+ assert_eq ! (
279+ missing_system_modules( & dir) ,
280+ vec![ "stdlib" , "store" ] ,
281+ "a fresh config needs both"
282+ ) ;
280283
281284 std:: fs:: create_dir_all ( dir. join ( "stdlib" ) ) . expect ( "stdlib dir" ) ;
282- assert_eq ! ( missing_system_modules( & dir) , vec![ "store" ] , "an installed module is left alone" ) ;
285+ assert_eq ! (
286+ missing_system_modules( & dir) ,
287+ vec![ "store" ] ,
288+ "an installed module is left alone"
289+ ) ;
283290
284291 std:: fs:: create_dir_all ( dir. join ( "store" ) ) . expect ( "store dir" ) ;
285292 assert ! ( missing_system_modules( & dir) . is_empty( ) , "nothing to seed once both exist" ) ;
0 commit comments