Skip to content

Commit

Permalink
Fix IMP being a valid NULL in class_replaceMethod
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 4, 2021
1 parent 9c8738c commit 109a816
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion objc_sys/src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ extern "C" {
name: *const objc_selector,
imp: IMP,
types: *const c_char,
) -> IMP;
) -> Option<IMP>;
pub fn class_replaceProperty(
cls: *mut objc_class,
name: *const c_char,
Expand Down
3 changes: 1 addition & 2 deletions objc_sys/src/various.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ pub struct objc_ivar {

/// A pointer to the start of a method implementation.
///
/// Remember that this is non-null!
/// Use `Option<IMP>` where nullability is expected. TODO
/// This must be non-null. Use `Option<IMP>` when nullability is desired.
pub type IMP = unsafe extern "C" fn();

/// Not available on macOS x86.
Expand Down

0 comments on commit 109a816

Please sign in to comment.