madsmtm / objc2

Bindings to Apple's frameworks in Rust
https://docs.rs/objc2/
MIT License
281 stars 35 forks source link

The feature flag for the number module in objc2-foundation appears to be incorrect #607

Closed libark closed 2 weeks ago

libark commented 2 weeks ago

index e4d76533..372c0b3d 100644
--- a/framework-crates/objc2-foundation/src/lib.rs
+++ b/framework-crates/objc2-foundation/src/lib.rs
@@ -110,7 +110,7 @@ mod generics;
 mod geometry;
 mod macros;
 mod ns_consumed;
-#[cfg(feature = "NSValue")]
+#[cfg(feature = "NSNumber")]
 mod number;
 #[cfg(feature = "NSProcessInfo")]
 mod process_info;```
madsmtm commented 2 weeks ago

It isn't, NSNumber is defined in Foundation/NSValue.h, so that's the feature flag that it should use. See this link for information about cargo features in framework crates.

The number module is just a few extension methods that we've implemented manually, they could've been placed anywhere.