Skip to content

Commit

Permalink
Merge pull request #1330 from thechampagne/master
Browse files Browse the repository at this point in the history
remove unnecessary heap allocation
  • Loading branch information
Cobrand authored Sep 1, 2023
2 parents bee13b5 + 23bedff commit ce32b1d
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 ce32b1d

Please sign in to comment.