@@ -84,15 +84,15 @@ fn read_config() -> Result<Config, Box<dyn Error>> {
8484/// Initializes the global config. Must be called before using `config()`.
8585fn init_config ( ) -> Result < ( ) , Box < dyn Error > > {
8686 let cfg = read_config ( ) ?;
87- CONFIG
88- . set ( cfg)
89- . map_err ( |_| "Config already initialized" ) ?;
87+ CONFIG . set ( cfg) . map_err ( |_| "Config already initialized" ) ?;
9088 Ok ( ( ) )
9189}
9290
9391/// Returns a reference to the global config.
9492pub fn config ( ) -> & ' static Config {
95- CONFIG . get ( ) . expect ( "Config not initialized. Call init_config() first." )
93+ CONFIG
94+ . get ( )
95+ . expect ( "Config not initialized. Call init_config() first." )
9696}
9797
9898fn default_storage_path ( file : & str ) -> PathBuf {
@@ -412,8 +412,10 @@ fn deploy(version: u32) -> Result<(), Box<dyn Error>> {
412412 let webapp_parameters = default_storage_path ( "webapp.parameters" ) ;
413413
414414 let version_path = default_storage_path ( "version" ) ;
415- let version_saved = std:: fs:: read_to_string ( & version_path)
416- . expect ( & format ! ( "version file not found: {}" , version_path. display( ) ) ) ;
415+ let version_saved = std:: fs:: read_to_string ( & version_path) . expect ( & format ! (
416+ "version file not found: {}" ,
417+ version_path. display( )
418+ ) ) ;
417419 let version_parsed: u32 = version_saved. trim ( ) . parse ( ) . unwrap ( ) ;
418420 let version_chosen = std:: cmp:: max ( version_parsed, version) ;
419421
@@ -426,11 +428,7 @@ fn deploy(version: u32) -> Result<(), Box<dyn Error>> {
426428 let repo_root = get_repo_root ( ) ?;
427429 let static_path = repo_root. join ( folder) ;
428430 if !static_path. exists ( ) {
429- return Err ( format ! (
430- "Static folder not found: {}" ,
431- static_path. display( )
432- )
433- . into ( ) ) ;
431+ return Err ( format ! ( "Static folder not found: {}" , static_path. display( ) ) . into ( ) ) ;
434432 }
435433 static_path
436434 }
0 commit comments