Skip to content

Commit

Permalink
remove unnecessary heap allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
thechampagne authored Sep 1, 2023
1 parent bee13b5 commit 23bedff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sdl2/video.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ impl WindowBuilder {
#[doc(alias = "SDL_CreateWindow")]
pub fn build(&self) -> Result<Window, WindowBuildError> {
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)),
};
Expand Down

0 comments on commit 23bedff

Please sign in to comment.