File tree 3 files changed +15
-14
lines changed
3 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -295,8 +295,8 @@ macro_rules! __def_fn {
295
295
// some of that specialization though!
296
296
{ } => { } ;
297
297
{
298
- #[ sel( $( $sel: tt) +) ]
299
298
$( #[ $m: meta] ) *
299
+ #sel!( $( $sel: tt) +)
300
300
$v: vis fn $name: ident(
301
301
$( & $self: ident) ?
302
302
$( & mut $mut_self: ident) ?
@@ -329,8 +329,8 @@ macro_rules! __def_fn {
329
329
}
330
330
} ;
331
331
{
332
- #[ sel( $( $sel: tt) +) ]
333
332
$( #[ $m: meta] ) *
333
+ #sel!( $( $sel: tt) +)
334
334
$v: vis fn $name: ident(
335
335
$( & $self: ident) ?
336
336
$( & mut $mut_self: ident) ?
@@ -363,8 +363,8 @@ macro_rules! __def_fn {
363
363
}
364
364
} ;
365
365
{
366
- #[ sel( $( $sel: tt) +) ]
367
366
$( #[ $m: meta] ) *
367
+ #sel!( $( $sel: tt) +)
368
368
$v: vis fn $name: ident(
369
369
$( & $self: ident) ?
370
370
$( & mut $mut_self: ident) ?
@@ -397,8 +397,8 @@ macro_rules! __def_fn {
397
397
}
398
398
} ;
399
399
{
400
- #[ sel( $( $sel: tt) +) ]
401
400
$( #[ $m: meta] ) *
401
+ #sel!( $( $sel: tt) +)
402
402
$v: vis fn $name: ident(
403
403
$( & $self: ident) ?
404
404
$( & mut $mut_self: ident) ?
Original file line number Diff line number Diff line change @@ -14,6 +14,12 @@ extern_class! {
14
14
/// See [Apple's documentation](https://developer.apple.com/documentation/foundation/nsmutablestring?language=objc).
15
15
#[ derive( PartialEq , Eq , Hash ) ]
16
16
unsafe pub struct NSMutableString : NSString , NSObject ;
17
+
18
+ unsafe impl {
19
+ /// Construct an empty [`NSMutableString`].
20
+ #sel!( new)
21
+ pub fn new( ) -> Id <Self , Owned >;
22
+ }
17
23
}
18
24
19
25
// TODO: SAFETY
@@ -22,11 +28,6 @@ unsafe impl Send for NSMutableString {}
22
28
23
29
/// Creating mutable strings.
24
30
impl NSMutableString {
25
- unsafe_def_fn ! {
26
- /// Construct an empty [`NSMutableString`].
27
- pub fn new -> Owned ;
28
- }
29
-
30
31
/// Creates a new [`NSMutableString`] by copying the given string slice.
31
32
#[ doc( alias = "initWithBytes:length:encoding:" ) ]
32
33
#[ allow( clippy:: should_implement_trait) ] // Not really sure of a better name
Original file line number Diff line number Diff line change @@ -11,20 +11,20 @@ __inner_extern_class! {
11
11
unsafe pub struct NSObject <>: Object { }
12
12
13
13
unsafe impl {
14
- #[ sel( new) ]
14
+ #sel! ( new)
15
15
pub fn new( ) -> Id <Self , Owned >;
16
16
17
- #[ sel( hash) ]
17
+ #sel! ( hash)
18
18
pub fn hash_code( & self ) -> usize ;
19
19
20
- #[ sel( isEqual: ) ]
20
+ #sel! ( isEqual: )
21
21
pub fn is_equal( & self , other: & NSObject ) -> bool ;
22
22
23
23
// TODO: Verify that description always returns a non-null string
24
- #[ sel( description) ]
24
+ #sel! ( description)
25
25
pub fn description( & self ) -> Id <NSString , Shared >;
26
26
27
- #[ sel( isKindOfClass: ) ]
27
+ #sel! ( isKindOfClass: )
28
28
pub fn is_kind_of( & self , cls: & Class ) -> bool ;
29
29
}
30
30
}
You can’t perform that action at this time.
0 commit comments