File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ use rocket::State;
99use rocket_contrib:: json:: JsonValue ;
1010use uuid:: Uuid ;
1111
12+ use crate :: config:: is_testing;
1213use crate :: config:: AWConfig ;
1314use crate :: dirs;
1415
@@ -88,24 +89,13 @@ fn get_device_id() -> String {
8889
8990#[ get( "/" ) ]
9091fn server_info ( ) -> JsonValue {
91- let testing: bool ;
92- #[ cfg( debug_assertions) ]
93- {
94- testing = true ;
95- }
96- //TODO: Should this be commented?
97- #[ cfg( not( debug_assertions) ) ]
98- {
99- testing = false ;
100- }
101-
10292 let hostname = gethostname ( ) . into_string ( ) . unwrap_or ( "unknown" . to_string ( ) ) ;
10393 const VERSION : Option < & ' static str > = option_env ! ( "CARGO_PKG_VERSION" ) ;
10494
10595 json ! ( {
10696 "hostname" : hostname,
107- "version" : format!( "aw-server-rust v{}" , VERSION . unwrap_or( "(unknown)" ) ) ,
108- "testing" : testing ,
97+ "version" : format!( "v{} (rust) " , VERSION . unwrap_or( "(unknown)" ) ) ,
98+ "testing" : is_testing ( ) ,
10999 "device_id" : get_device_id( ) ,
110100 } )
111101}
You can’t perform that action at this time.
0 commit comments