Skip to content

Commit 7c7efbd

Browse files
committed
Add NSNotFound
1 parent a5e13c5 commit 7c7efbd

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

objc2/CHANGELOG_FOUNDATION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1212
* Added `NSSet`.
1313
* Added `NSMutableSet`.
1414
* Added `NSMutableDictionary`.
15+
* Added `NSNotFound`.
1516

1617

1718
## objc2 0.3.0-beta.2 - 2022-08-28

objc2/src/foundation/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ pub use self::zone::NSZone;
8484
#[doc(no_inline)]
8585
pub use crate::ffi::{NSInteger, NSUInteger};
8686

87+
/// A value indicating that a requested item couldn’t be found or doesn’t exist.
88+
///
89+
/// See [Apple's documentation](https://developer.apple.com/documentation/foundation/nsnotfound?language=objc).
90+
#[allow(non_upper_case_globals)]
91+
pub const NSNotFound: NSInteger = crate::ffi::NSIntegerMax;
92+
8793
#[cfg(feature = "apple")]
8894
#[link(name = "Foundation", kind = "framework")]
8995
extern "C" {}

objc2/src/foundation/string.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use core::str;
1010
use std::os::raw::c_char;
1111

1212
use super::{NSComparisonResult, NSCopying, NSMutableCopying, NSMutableString, NSObject};
13-
use crate::ffi;
1413
use crate::rc::{autoreleasepool, AutoreleasePool, DefaultId, Id, Shared};
1514
use crate::runtime::{Class, Object};
1615
use crate::{extern_class, extern_methods, msg_send, msg_send_id, ClassType};
@@ -20,10 +19,6 @@ const UTF8_ENCODING: usize = 4;
2019
#[cfg(feature = "gnustep-1-7")]
2120
const UTF8_ENCODING: i32 = 4;
2221

23-
#[allow(unused)]
24-
#[allow(non_upper_case_globals)]
25-
const NSNotFound: ffi::NSInteger = ffi::NSIntegerMax;
26-
2722
extern_class!(
2823
/// An immutable, plain-text Unicode string object.
2924
///

0 commit comments

Comments
 (0)