Skip to content

Commit ce32b1d

Browse files
authored
Merge pull request #1330 from thechampagne/master
remove unnecessary heap allocation
2 parents bee13b5 + 23bedff commit ce32b1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sdl2/video.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ impl WindowBuilder {
11341134
#[doc(alias = "SDL_CreateWindow")]
11351135
pub fn build(&self) -> Result<Window, WindowBuildError> {
11361136
use self::WindowBuildError::*;
1137-
let title = match CString::new(self.title.clone()) {
1137+
let title = match CString::new(self.title.as_bytes()) {
11381138
Ok(t) => t,
11391139
Err(err) => return Err(InvalidTitle(err)),
11401140
};

0 commit comments

Comments
 (0)