Skip to content

Commit

Permalink
Merge pull request #245 from zatchl/nsset
Browse files Browse the repository at this point in the history
Add `NSSet` and `NSMutableSet`
  • Loading branch information
madsmtm authored Aug 29, 2022
2 parents 9ccb3a4 + d74d7cb commit 9ab6bf3
Show file tree
Hide file tree
Showing 5 changed files with 1,064 additions and 5 deletions.
11 changes: 11 additions & 0 deletions objc2/src/foundation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ pub use self::geometry::{CGFloat, NSPoint, NSRect, NSSize};
pub use self::mutable_array::NSMutableArray;
pub use self::mutable_attributed_string::NSMutableAttributedString;
pub use self::mutable_data::NSMutableData;
pub use self::mutable_set::NSMutableSet;
pub use self::mutable_string::NSMutableString;
pub use self::number::NSNumber;
pub use self::object::NSObject;
pub use self::process_info::NSProcessInfo;
pub use self::range::NSRange;
pub use self::set::NSSet;
pub use self::string::NSString;
pub use self::thread::{is_main_thread, is_multi_threaded, MainThreadMarker, NSThread};
#[cfg(not(macos_10_7))] // Temporary
Expand Down Expand Up @@ -104,11 +106,13 @@ mod geometry;
mod mutable_array;
mod mutable_attributed_string;
mod mutable_data;
mod mutable_set;
mod mutable_string;
mod number;
mod object;
mod process_info;
mod range;
mod set;
mod string;
mod thread;
// Temporarily disable testing UUID on macOS 10.7 until
Expand Down Expand Up @@ -158,6 +162,12 @@ mod tests {
assert_auto_traits::<NSComparisonResult>();
assert_auto_traits::<NSData>();
assert_auto_traits::<NSDictionary<NSString, NSString>>();
assert_auto_traits::<NSSet<NSString, Shared>>();
assert_auto_traits::<NSSet<NSString, Owned>>();
assert_auto_traits::<Id<NSSet<NSString, Shared>, Shared>>();
assert_auto_traits::<Id<NSSet<NSString, Owned>, Shared>>();
assert_auto_traits::<Id<NSSet<NSString, Shared>, Owned>>();
assert_auto_traits::<Id<NSSet<NSString, Owned>, Owned>>();
// TODO: Figure out if Send + Sync is safe?
// assert_auto_traits::<NSEnumerator<NSString>>();
// assert_auto_traits::<NSFastEnumerator<NSArray<NSString, Shared>>>();
Expand All @@ -170,6 +180,7 @@ mod tests {
assert_auto_traits::<NSMutableArray<NSString, Shared>>();
assert_auto_traits::<NSMutableAttributedString>();
assert_auto_traits::<NSMutableData>();
assert_auto_traits::<NSMutableSet<NSString, Shared>>();
assert_auto_traits::<NSMutableString>();
assert_auto_traits::<NSNumber>();
// assert_auto_traits::<NSObject>(); // Intentional
Expand Down
Loading

0 comments on commit 9ab6bf3

Please sign in to comment.