diff --git a/strafe-client/src/main.rs b/strafe-client/src/main.rs index 337ba79..d580614 100644 --- a/strafe-client/src/main.rs +++ b/strafe-client/src/main.rs @@ -12,6 +12,8 @@ mod model_graphics; mod physics_worker; mod graphics_worker; +const TITLE:&'static str=concat!("Strafe Client v",env!("CARGO_PKG_VERSION")); + fn main(){ - setup::setup_and_start(format!("Strafe Client v{}",env!("CARGO_PKG_VERSION"))); + setup::setup_and_start(TITLE); } diff --git a/strafe-client/src/setup.rs b/strafe-client/src/setup.rs index 790352d..5b3b5b8 100644 --- a/strafe-client/src/setup.rs +++ b/strafe-client/src/setup.rs @@ -192,14 +192,14 @@ pub struct SetupContext<'a>{ pub config:wgpu::SurfaceConfiguration, } -pub fn setup_and_start(title:String){ +pub fn setup_and_start(title:&str){ let event_loop=winit::event_loop::EventLoop::new().unwrap(); println!("Initializing the surface..."); let partial_1=create_instance(); - let window=create_window(title.as_str(),&event_loop).unwrap(); + let window=create_window(title,&event_loop).unwrap(); let partial_2=partial_1.create_surface(&window).unwrap();