Factor out static_cfg from static init of messages
Factor out a macro for static references to data parsed from config files at compile-time.
This commit is contained in:
		
							parent
							
								
									405dbffe37
								
							
						
					
					
						commit
						67d18b486c
					
				
					 4 changed files with 45 additions and 12 deletions
				
			
		
							
								
								
									
										11
									
								
								src/main.rs
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								src/main.rs
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -25,9 +25,10 @@ mod game;
 | 
			
		|||
#[macro_use]
 | 
			
		||||
mod types;
 | 
			
		||||
mod entities;
 | 
			
		||||
#[macro_use]
 | 
			
		||||
mod util;
 | 
			
		||||
mod messages;
 | 
			
		||||
mod settings;
 | 
			
		||||
mod util;
 | 
			
		||||
 | 
			
		||||
use clap::App;
 | 
			
		||||
use game::Game;
 | 
			
		||||
| 
						 | 
				
			
			@ -49,13 +50,9 @@ fn init(
 | 
			
		|||
    h: u16,
 | 
			
		||||
) {
 | 
			
		||||
    panic::set_hook(if settings.logging.print_backtrace {
 | 
			
		||||
        Box::new(|info| {
 | 
			
		||||
            (error!("{}\n{:#?}", info, Backtrace::new()))
 | 
			
		||||
        })
 | 
			
		||||
        Box::new(|info| (error!("{}\n{:#?}", info, Backtrace::new())))
 | 
			
		||||
    } else {
 | 
			
		||||
        Box::new(|info| {
 | 
			
		||||
            (error!("{}\n{:#?}", info, Backtrace::new()))
 | 
			
		||||
        })
 | 
			
		||||
        Box::new(|info| (error!("{}\n{:#?}", info, Backtrace::new())))
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    let game = Game::new(settings, stdout, stdin, w, h);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue