File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ struct ConfigFile {
1717
1818impl Config {
1919 pub fn from_file < P : AsRef < Path > > ( path : P ) -> Config {
20- let mut file = File :: open ( path) . unwrap ( ) ;
20+ let mut file = File :: open ( path) . expect ( "Opening config file" ) ;
2121 let mut contents = String :: new ( ) ;
22- file. read_to_string ( & mut contents) . unwrap ( ) ;
22+ file. read_to_string ( & mut contents) . expect ( "Reading config file" ) ;
2323 let config: ConfigFile = toml:: from_str ( & contents) . unwrap ( ) ;
2424 let socket_mode = config. socket_mode . map ( |m| u32:: from_str_radix ( & m, 8 ) . unwrap ( ) ) ;
2525 Config {
Original file line number Diff line number Diff line change @@ -218,7 +218,7 @@ fn main() {
218218 hbse. add ( Box :: new ( DirectorySource :: new ( "/usr/share/better-than-basic/templates" , ".hbs" ) ) ) ;
219219
220220 if let Err ( r) = hbse. reload ( ) {
221- panic ! ( "{}" , r) ;
221+ panic ! ( "Error loading templates: {}" , r) ;
222222 }
223223
224224 let mut router = Router :: new ( ) ;
Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ pub enum LoginResult {
3232
3333impl Users {
3434 pub fn from_file < P : AsRef < Path > > ( path : P ) -> Users {
35- let mut file = File :: open ( path) . unwrap ( ) ;
35+ let mut file = File :: open ( path) . expect ( "Opening users file" ) ;
3636 let mut contents = String :: new ( ) ;
37- file. read_to_string ( & mut contents) . unwrap ( ) ;
37+ file. read_to_string ( & mut contents) . expect ( "Reading users file" ) ;
3838 let users_table = contents. parse :: < Value > ( ) . unwrap ( ) ;
3939 let users = users_table. as_table ( )
4040 . unwrap ( )
You can’t perform that action at this time.
0 commit comments