Skip to content

Commit

Permalink
external-bindings: Replace use of CString::from_str
Browse files Browse the repository at this point in the history
Apparently CString only implements FromStr as of version 1.84 so it
was causing most GH Actions builds to break.
  • Loading branch information
caseif committed Jan 21, 2025
1 parent 7194433 commit 5c560bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions external-bindings/sdl2/src/wrapper/hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ pub const SDL_HINT_TRACKPAD_IS_TOUCH_ONLY: &str =
unsafe { from_c_define(crate::bindings::SDL_HINT_TRACKPAD_IS_TOUCH_ONLY) };

pub fn sdl_set_hint(hint: impl AsRef<str>, value: impl AsRef<str>) {
let hint_c = CString::from_str(hint.as_ref()).unwrap();
let value_c = CString::from_str(value.as_ref()).unwrap();
let hint_c = CString::new(hint.as_ref()).unwrap();
let value_c = CString::new(value.as_ref()).unwrap();
unsafe { SDL_SetHint(hint_c.as_ptr(), value_c.as_ptr()) };
}

0 comments on commit 5c560bb

Please sign in to comment.