Skip to content

Commit

Permalink
Make Context::get_function safe, add must_use
Browse files Browse the repository at this point in the history
It just returns a pointer, which is a safe operation.
  • Loading branch information
crumblingstatue committed Feb 21, 2024
1 parent 8e2f900 commit 3e275e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/window/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ impl Context {
/// * name - Name of the function to get the address of
///
/// Returns the address of the OpenGL function, 0 on failure
pub unsafe fn get_function(name: &CStr) -> *const std::ffi::c_void {
#[must_use]
pub fn get_function(name: &CStr) -> *const std::ffi::c_void {
unsafe { ffi::sfContext_getFunction(name.as_ptr()) }
}
}
Expand Down

0 comments on commit 3e275e0

Please sign in to comment.