Skip to content

Commit dfb7562

Browse files
committed
Remove old internal Foundation re-export
This was used back when the crates were called `icrate`, but now that they are split, it no longer makes sense.
1 parent ec058b3 commit dfb7562

32 files changed

+79
-86
lines changed

framework-crates/objc2-foundation/src/__macro_helpers/ns_string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! `utf16_lit`, `windows`, `const_utf16`, `wide-literals`, ...
1616
use core::ffi::c_void;
1717

18-
use crate::Foundation::NSString;
18+
use crate::NSString;
1919
use objc2::runtime::AnyClass;
2020

2121
// This is defined in CoreFoundation, but we don't emit a link attribute

framework-crates/objc2-foundation/src/attributed_string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use core::panic::{RefUnwindSafe, UnwindSafe};
44
use objc2::rc::Retained;
55
use objc2::AllocAnyThread;
66

7-
use crate::Foundation::*;
7+
use crate::*;
88

99
// Same reasoning as `NSString`.
1010
impl UnwindSafe for NSAttributedString {}

framework-crates/objc2-foundation/src/bundle.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
use core::fmt;
22
use core::panic::{RefUnwindSafe, UnwindSafe};
33

4-
use crate::Foundation::NSBundle;
4+
use crate::NSBundle;
55

66
impl UnwindSafe for NSBundle {}
77
impl RefUnwindSafe for NSBundle {}
88

99
impl NSBundle {
1010
#[cfg(feature = "NSString")]
1111
#[cfg(feature = "NSDictionary")]
12-
pub fn name(&self) -> Option<objc2::rc::Retained<crate::Foundation::NSString>> {
13-
use crate::{ns_string, Foundation::NSString};
12+
pub fn name(&self) -> Option<objc2::rc::Retained<crate::NSString>> {
13+
use crate::{ns_string, NSString};
1414
use objc2::rc::Retained;
1515

1616
let info = self.infoDictionary()?;

framework-crates/objc2-foundation/src/data.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use objc2::rc::Retained;
1313
use objc2::rc::RetainedFromIterator;
1414
use objc2::{extern_methods, AllocAnyThread};
1515

16-
use crate::Foundation::{NSData, NSMutableData};
16+
use crate::{NSData, NSMutableData};
1717

1818
impl UnwindSafe for NSData {}
1919
impl RefUnwindSafe for NSData {}

framework-crates/objc2-foundation/src/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use core::fmt;
33
use core::panic::{RefUnwindSafe, UnwindSafe};
44

5-
use crate::Foundation::NSError;
5+
use crate::NSError;
66

77
impl UnwindSafe for NSError {}
88
impl RefUnwindSafe for NSError {}

framework-crates/objc2-foundation/src/exception.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use objc2::rc::Retained;
88
use objc2::runtime::{NSObject, NSObjectProtocol};
99
use objc2::{extern_methods, sel};
1010

11-
use crate::Foundation::NSException;
11+
use crate::NSException;
1212

1313
// SAFETY: Exception objects are immutable data containers, and documented as
1414
// thread safe.
@@ -33,9 +33,9 @@ impl NSException {
3333
#[cfg(all(feature = "NSObjCRuntime", feature = "NSString"))]
3434
#[cfg(feature = "NSDictionary")]
3535
pub fn new(
36-
name: &crate::Foundation::NSExceptionName,
37-
reason: Option<&crate::Foundation::NSString>,
38-
user_info: Option<&crate::Foundation::NSDictionary>,
36+
name: &crate::NSExceptionName,
37+
reason: Option<&crate::NSString>,
38+
user_info: Option<&crate::NSDictionary>,
3939
) -> Option<Retained<Self>> {
4040
use objc2::AllocAnyThread;
4141

framework-crates/objc2-foundation/src/geometry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ mod tests {
422422
))]
423423
#[cfg(feature = "NSGeometry")]
424424
fn test_partial_eq() {
425-
use crate::Foundation::{NSEqualPoints, NSEqualRects, NSEqualSizes};
425+
use crate::{NSEqualPoints, NSEqualRects, NSEqualSizes};
426426

427427
// We assume that comparisons handle e.g. `x` and `y` in the same way,
428428
// therefore we set the coordinates / dimensions to the same.

framework-crates/objc2-foundation/src/iter.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use objc2::runtime::ProtocolObject;
88
use objc2::ClassType;
99
use objc2::Message;
1010

11-
use crate::Foundation::{NSFastEnumeration, NSFastEnumerationState};
11+
use crate::{NSFastEnumeration, NSFastEnumerationState};
1212

1313
/// Swift and Objective-C both have a stack buffer size of 16, so we do that
1414
/// as well.
@@ -654,11 +654,10 @@ macro_rules! __impl_into_iter {
654654
#[cfg(feature = "NSValue")]
655655
mod tests {
656656
use alloc::vec::Vec;
657-
658-
use super::*;
659657
use core::mem::size_of;
660658

661-
use crate::Foundation::{NSArray, NSNumber};
659+
use super::*;
660+
use crate::{NSArray, NSNumber};
662661

663662
#[test]
664663
#[cfg_attr(

framework-crates/objc2-foundation/src/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,3 @@ pub(crate) type FourCharCode = u32;
184184
pub type OSType = FourCharCode;
185185
#[allow(unused)]
186186
pub(crate) type UTF32Char = u32; // Or maybe Rust's char?
187-
188-
// Temporary
189-
#[allow(non_snake_case, unused, unreachable_pub)]
190-
mod Foundation {
191-
pub use crate::*;
192-
}

framework-crates/objc2-foundation/src/macros/ns_string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
///
33
/// Equivalent to the [boxed C-strings] `@"string"` syntax in Objective-C.
44
///
5-
/// [`NSString`]: crate::Foundation::NSString
5+
/// [`NSString`]: crate::NSString
66
/// [boxed C-strings]: https://clang.llvm.org/docs/ObjectiveCLiterals.html#boxed-c-strings
77
///
88
///
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
extern "C" {
22
#[cfg(feature = "NSMapTable")]
3-
pub fn NSFreeMapTable(table: *mut crate::Foundation::NSMapTable);
3+
pub fn NSFreeMapTable(table: *mut crate::NSMapTable);
44
}
55

66
// TODO: Add `-[NSKeyedUnarchiverDelegate unarchiver:didDecodeObject:]`

framework-crates/objc2-foundation/src/number.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use core::panic::{RefUnwindSafe, UnwindSafe};
2424
use objc2::encode::Encoding;
2525
use objc2::rc::Retained;
2626

27-
use crate::Foundation::NSNumber;
27+
use crate::NSNumber;
2828

2929
impl UnwindSafe for NSNumber {}
3030
impl RefUnwindSafe for NSNumber {}
@@ -61,7 +61,7 @@ impl NSNumber {
6161

6262
#[inline]
6363
#[cfg(feature = "NSGeometry")]
64-
pub fn new_cgfloat(val: crate::Foundation::CGFloat) -> Retained<Self> {
64+
pub fn new_cgfloat(val: crate::CGFloat) -> Retained<Self> {
6565
#[cfg(target_pointer_width = "64")]
6666
{
6767
Self::new_f64(val)
@@ -105,7 +105,7 @@ impl NSNumber {
105105

106106
#[inline]
107107
#[cfg(feature = "NSGeometry")]
108-
pub fn as_cgfloat(&self) -> crate::Foundation::CGFloat {
108+
pub fn as_cgfloat(&self) -> crate::CGFloat {
109109
#[cfg(target_pointer_width = "64")]
110110
{
111111
self.as_f64()

framework-crates/objc2-foundation/src/process_info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use core::fmt;
33
use core::panic::{RefUnwindSafe, UnwindSafe};
44

5-
use crate::Foundation::NSProcessInfo;
5+
use crate::NSProcessInfo;
66

77
// SAFETY: The documentation explicitly states:
88
// > NSProcessInfo is thread-safe in macOS 10.7 and later.

framework-crates/objc2-foundation/src/range.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use core::ops::Range;
22

33
use objc2::encode::{Encode, Encoding, RefEncode};
44

5-
use crate::Foundation::NSUInteger;
5+
use crate::NSUInteger;
66

77
/// TODO.
88
///

framework-crates/objc2-foundation/src/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl NSString {
170170
///
171171
/// Prefer using the [`ns_string!`] macro when possible.
172172
///
173-
/// [`ns_string!`]: crate::Foundation::ns_string
173+
/// [`ns_string!`]: crate::ns_string
174174
#[doc(alias = "initWithBytes")]
175175
#[doc(alias = "initWithBytes:length:encoding:")]
176176
#[allow(clippy::should_implement_trait)] // Not really sure of a better name

framework-crates/objc2-foundation/src/tests/attributed_string.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use alloc::string::ToString;
66
use objc2::rc::{autoreleasepool, Retained};
77
use objc2::runtime::AnyObject;
88

9-
use crate::Foundation::{self, ns_string, NSAttributedString, NSObject, NSString};
9+
use crate::{ns_string, NSAttributedString, NSMutableAttributedString, NSObject, NSString};
1010

1111
#[test]
1212
fn test_new() {
@@ -32,7 +32,7 @@ fn test_from_nsstring() {
3232

3333
#[test]
3434
fn test_copy() {
35-
use Foundation::{NSCopying, NSMutableCopying, NSObjectProtocol};
35+
use crate::{NSCopying, NSMutableCopying, NSObjectProtocol};
3636

3737
let s1 = NSAttributedString::from_nsstring(ns_string!("abc"));
3838
let s2 = s1.copy();
@@ -43,7 +43,7 @@ fn test_copy() {
4343

4444
let s3 = s1.mutableCopy();
4545
assert_ne!(Retained::as_ptr(&s1), Retained::as_ptr(&s3).cast());
46-
assert!(s3.is_kind_of::<Foundation::NSMutableAttributedString>());
46+
assert!(s3.is_kind_of::<NSMutableAttributedString>());
4747
}
4848

4949
#[test]
@@ -62,7 +62,7 @@ fn test_debug() {
6262
let s = unsafe {
6363
NSAttributedString::new_with_attributes(
6464
ns_string!("abc"),
65-
&Foundation::NSDictionary::from_retained_objects(&[ns_string!("test")], &[obj]),
65+
&crate::NSDictionary::from_retained_objects(&[ns_string!("test")], &[obj]),
6666
)
6767
};
6868
let expected = if cfg!(feature = "gnustep-1-7") {
@@ -75,7 +75,7 @@ fn test_debug() {
7575

7676
#[test]
7777
fn test_new_mutable() {
78-
let s = Foundation::NSMutableAttributedString::new();
78+
let s = NSMutableAttributedString::new();
7979
assert_eq!(&s.string().to_string(), "");
8080
}
8181

@@ -85,14 +85,14 @@ fn test_new_mutable() {
8585
ignore = "thread safety issues regarding initialization"
8686
)]
8787
fn test_copy_mutable() {
88-
use Foundation::{NSCopying, NSMutableCopying, NSObjectProtocol};
88+
use crate::{NSCopying, NSMutableCopying, NSObjectProtocol};
8989

90-
let s1 = Foundation::NSMutableAttributedString::from_nsstring(ns_string!("abc"));
90+
let s1 = NSMutableAttributedString::from_nsstring(ns_string!("abc"));
9191
let s2 = s1.copy();
9292
assert_ne!(Retained::as_ptr(&s1).cast(), Retained::as_ptr(&s2));
9393
assert!(s2.is_kind_of::<NSAttributedString>());
9494

9595
let s3 = s1.mutableCopy();
9696
assert_ne!(Retained::as_ptr(&s1), Retained::as_ptr(&s3));
97-
assert!(s3.is_kind_of::<Foundation::NSMutableAttributedString>());
97+
assert!(s3.is_kind_of::<NSMutableAttributedString>());
9898
}

framework-crates/objc2-foundation/src/tests/bundle.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg(feature = "NSBundle")]
22
use alloc::format;
33

4-
use crate::Foundation::NSBundle;
4+
use crate::NSBundle;
55

66
#[test]
77
#[cfg(feature = "NSString")]

framework-crates/objc2-foundation/src/tests/data.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg(feature = "NSData")]
22
use alloc::{format, vec};
33

4-
use crate::Foundation::NSData;
4+
use crate::NSData;
55

66
#[test]
77
fn test_bytes() {

framework-crates/objc2-foundation/src/tests/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![cfg(feature = "NSString")]
33
use alloc::format;
44

5-
use crate::Foundation::{ns_string, NSCocoaErrorDomain, NSError};
5+
use crate::{ns_string, NSCocoaErrorDomain, NSError};
66

77
#[test]
88
fn basic() {

framework-crates/objc2-foundation/src/tests/lock.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![cfg(feature = "NSLock")]
2-
use crate::Foundation::{NSLock, NSLocking};
2+
use crate::{NSLock, NSLocking};
33

44
#[test]
55
fn lock_unlock() {

framework-crates/objc2-foundation/src/tests/mutable_data.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![cfg(feature = "NSData")]
22

3-
use crate::Foundation::{NSData, NSMutableData};
3+
use crate::{NSData, NSMutableData};
44

55
#[test]
66
fn test_bytes_mut() {

framework-crates/objc2-foundation/src/tests/mutable_string.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use core::any::TypeId;
55
use core::fmt::Write;
66
use objc2::runtime::NSObject;
77

8-
use crate::Foundation::{NSMutableString, NSString};
98
use crate::{CopyingHelper, MutableCopyingHelper};
9+
use crate::{NSMutableString, NSString};
1010

1111
#[test]
1212
fn display_debug() {
@@ -50,7 +50,7 @@ fn test_with_capacity() {
5050
#[test]
5151
#[cfg(feature = "NSObject")]
5252
fn test_copy() {
53-
use crate::Foundation::{NSCopying, NSMutableCopying, NSObjectProtocol};
53+
use crate::{NSCopying, NSMutableCopying, NSObjectProtocol};
5454
use objc2::rc::Retained;
5555

5656
let s1 = NSMutableString::from_str("abc");
@@ -87,7 +87,7 @@ fn counterpart() {
8787
#[test]
8888
#[cfg(all(feature = "NSObject", feature = "NSZone"))]
8989
fn test_copy_with_zone() {
90-
use crate::Foundation::{NSCopying, NSMutableCopying, NSObjectProtocol};
90+
use crate::{NSCopying, NSMutableCopying, NSObjectProtocol};
9191
use objc2::rc::Retained;
9292

9393
let s1 = NSString::from_str("abc");

framework-crates/objc2-foundation/src/tests/number.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg(feature = "NSValue")]
22
use alloc::format;
33

4-
use crate::Foundation::NSNumber;
4+
use crate::NSNumber;
55

66
#[test]
77
fn basic() {

framework-crates/objc2-foundation/src/tests/process_info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![cfg(feature = "NSProcessInfo")]
33
use alloc::format;
44

5-
use crate::Foundation::NSProcessInfo;
5+
use crate::NSProcessInfo;
66

77
#[test]
88
fn debug() {

framework-crates/objc2-foundation/src/tests/proxy.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![cfg(feature = "NSProxy")]
2-
use crate::Foundation::NSProxy;
2+
use crate::NSProxy;
33
use objc2::ClassType;
44

55
#[test]

framework-crates/objc2-foundation/src/tests/string.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use alloc::string::ToString;
44

55
use objc2::rc::autoreleasepool;
66

7-
use crate::Foundation::{ns_string, NSString};
7+
use crate::{ns_string, NSString};
88

99
#[test]
1010
fn test_equality() {
@@ -79,7 +79,7 @@ fn test_interior_nul() {
7979
#[test]
8080
#[cfg(feature = "NSObject")]
8181
fn test_copy() {
82-
use crate::Foundation::{NSCopying, NSMutableCopying, NSMutableString, NSObjectProtocol};
82+
use crate::{NSCopying, NSMutableCopying, NSMutableString, NSObjectProtocol};
8383
use objc2::rc::Retained;
8484

8585
let s1 = NSString::from_str("abc");
@@ -96,7 +96,7 @@ fn test_copy() {
9696
#[test]
9797
#[cfg(feature = "NSObject")]
9898
fn test_copy_nsstring_is_same() {
99-
use crate::Foundation::NSCopying;
99+
use crate::NSCopying;
100100

101101
let string1 = NSString::from_str("Hello, world!");
102102
let string2 = string1.copy();

framework-crates/objc2-foundation/src/tests/uuid.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![cfg(feature = "NSUUID")]
22
use alloc::format;
33

4-
use crate::Foundation::NSUUID;
4+
use crate::NSUUID;
55
use objc2::rc::Retained;
66

77
#[test]

0 commit comments

Comments
 (0)