Skip to content

Commit

Permalink
Fix GNUStep NSMutableData new
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Aug 27, 2023
1 parent cf9cfc4 commit e955036
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/icrate/tests/mutable_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ fn test_as_ref_borrow() {
fn impls_borrow<T: AsRef<U> + Borrow<U> + ?Sized, U: ?Sized>(_: &T) {}
fn impls_borrow_mut<T: AsMut<U> + BorrowMut<U> + ?Sized, U: ?Sized>(_: &mut T) {}

let mut obj = NSMutableData::new();
// TODO: For some reason `new` doesn't work on GNUStep in release mode?
let mut obj = if cfg!(feature = "gnustep-1-8") {
NSMutableData::with_bytes(&[])
} else {
NSMutableData::new()
};
impls_borrow::<Id<NSMutableData>, NSMutableData>(&obj);
impls_borrow_mut::<Id<NSMutableData>, NSMutableData>(&mut obj);

Expand Down

0 comments on commit e955036

Please sign in to comment.