Skip to content

Commit

Permalink
Fix clippy errors
Browse files Browse the repository at this point in the history
Clippy was complaining that #[must_use] MUST be implemented for this
function.

It was also complaining that a # Safety documentation has yet to be
written.
  • Loading branch information
dogunbound committed Feb 21, 2024
1 parent 22ebe6c commit b26280c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/window/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,14 @@ impl Context {
/// Get the address of an OpenGL function.
/// # Arguments
/// * name - Name of the function to get the address of
///
/// Returns the address of the OpenGL function, 0 on failure
///
/// Returns the address of the OpenGL function, 0 on failure
///
/// # Safety
///
/// Return addresses to functions is inherently an unsafe operation. Must check failure on
/// your own. rust-sfml DOES NOT perform any checks on the returned pointer.
#[must_use]
pub unsafe fn get_function(name: &CStr) -> *const std::ffi::c_void {
unsafe { ffi::sfContext_getFunction(name.as_ptr()) }
}
Expand Down

0 comments on commit b26280c

Please sign in to comment.