From 23bedff427d91938a210095b8caec010c2caed8d Mon Sep 17 00:00:00 2001 From: XXIV <13811862+thechampagne@users.noreply.github.com> Date: Fri, 1 Sep 2023 05:05:55 +0300 Subject: [PATCH] remove unnecessary heap allocation --- src/sdl2/video.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl2/video.rs b/src/sdl2/video.rs index ed282acdca..da7a279a70 100644 --- a/src/sdl2/video.rs +++ b/src/sdl2/video.rs @@ -1134,7 +1134,7 @@ impl WindowBuilder { #[doc(alias = "SDL_CreateWindow")] pub fn build(&self) -> Result { use self::WindowBuildError::*; - let title = match CString::new(self.title.clone()) { + let title = match CString::new(self.title.as_bytes()) { Ok(t) => t, Err(err) => return Err(InvalidTitle(err)), };