Skip to content

Commit cd5a01e

Browse files
committed
Make window config not copy
1 parent a5e0338 commit cd5a01e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/glass.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ impl ApplicationHandler for Glass {
8484
if !runner_state.is_init {
8585
// Create windows from initial configs
8686
let mut winit_windows = vec![];
87-
for &window_config in config.window_configs.iter() {
87+
for window_config in config.window_configs.iter() {
8888
winit_windows.push((
89-
window_config,
89+
window_config.clone(),
9090
GlassContext::create_winit_window(event_loop, &window_config).unwrap(),
9191
))
9292
}
@@ -485,7 +485,7 @@ impl GlassContext {
485485
) -> Result<Arc<Window>, GlassError> {
486486
let mut window_attributes = Window::default_attributes()
487487
.with_inner_size(winit::dpi::LogicalSize::new(config.width, config.height))
488-
.with_title(config.title);
488+
.with_title(config.title.clone());
489489

490490
// Min size
491491
if let Some(inner_size) = config.min_size {

src/window.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ use winit::{
1212

1313
use crate::device_context::DeviceContext;
1414

15-
#[derive(Debug, Copy, Clone)]
15+
#[derive(Debug, Clone)]
1616
pub struct WindowConfig {
17-
pub title: &'static str,
17+
pub title: String,
1818
pub width: u32,
1919
pub height: u32,
2020
pub pos: WindowPos,
@@ -30,7 +30,7 @@ pub struct WindowConfig {
3030
impl Default for WindowConfig {
3131
fn default() -> Self {
3232
Self {
33-
title: "App",
33+
title: "App".to_string(),
3434
width: 1920,
3535
height: 1080,
3636
pos: WindowPos::Centered,

0 commit comments

Comments
 (0)