Skip to content

Commit ade656c

Browse files
committed
Add NSSet and NSMutableSet
1 parent 3cbef36 commit ade656c

File tree

5 files changed

+1063
-5
lines changed

5 files changed

+1063
-5
lines changed

objc2/src/foundation/mod.rs

+11
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ pub use self::geometry::{CGFloat, NSPoint, NSRect, NSSize};
6464
pub use self::mutable_array::NSMutableArray;
6565
pub use self::mutable_attributed_string::NSMutableAttributedString;
6666
pub use self::mutable_data::NSMutableData;
67+
pub use self::mutable_set::NSMutableSet;
6768
pub use self::mutable_string::NSMutableString;
6869
pub use self::number::NSNumber;
6970
pub use self::object::NSObject;
7071
pub use self::process_info::NSProcessInfo;
7172
pub use self::range::NSRange;
73+
pub use self::set::NSSet;
7274
pub use self::string::NSString;
7375
pub use self::thread::{is_main_thread, is_multi_threaded, MainThreadMarker, NSThread};
7476
#[cfg(not(macos_10_7))] // Temporary
@@ -104,11 +106,13 @@ mod geometry;
104106
mod mutable_array;
105107
mod mutable_attributed_string;
106108
mod mutable_data;
109+
mod mutable_set;
107110
mod mutable_string;
108111
mod number;
109112
mod object;
110113
mod process_info;
111114
mod range;
115+
mod set;
112116
mod string;
113117
mod thread;
114118
// Temporarily disable testing UUID on macOS 10.7 until
@@ -158,6 +162,12 @@ mod tests {
158162
assert_auto_traits::<NSComparisonResult>();
159163
assert_auto_traits::<NSData>();
160164
assert_auto_traits::<NSDictionary<NSString, NSString>>();
165+
assert_auto_traits::<NSSet<NSString, Shared>>();
166+
assert_auto_traits::<NSSet<NSString, Owned>>();
167+
assert_auto_traits::<Id<NSSet<NSString, Shared>, Shared>>();
168+
assert_auto_traits::<Id<NSSet<NSString, Owned>, Shared>>();
169+
assert_auto_traits::<Id<NSSet<NSString, Shared>, Owned>>();
170+
assert_auto_traits::<Id<NSSet<NSString, Owned>, Owned>>();
161171
// TODO: Figure out if Send + Sync is safe?
162172
// assert_auto_traits::<NSEnumerator<NSString>>();
163173
// assert_auto_traits::<NSFastEnumerator<NSArray<NSString, Shared>>>();
@@ -170,6 +180,7 @@ mod tests {
170180
assert_auto_traits::<NSMutableArray<NSString, Shared>>();
171181
assert_auto_traits::<NSMutableAttributedString>();
172182
assert_auto_traits::<NSMutableData>();
183+
assert_auto_traits::<NSMutableSet<NSString, Shared>>();
173184
assert_auto_traits::<NSMutableString>();
174185
assert_auto_traits::<NSNumber>();
175186
// assert_auto_traits::<NSObject>(); // Intentional

0 commit comments

Comments
 (0)