1
1
macro_rules! object_struct {
2
2
( $name: ident) => (
3
- object_struct!( $name, ) ;
4
- ) ;
5
- ( $name: ident<$( $t: ident) ,+>) => (
6
- object_struct!( $name, $( $t) ,+) ;
7
- ) ;
8
- ( $name: ident, $( $t: ident) ,* ) => (
9
- pub enum $name<$( $t) ,* > { }
3
+ pub struct $name {
4
+ _private: ( ) ,
5
+ }
10
6
11
- object_impl!( $name $ ( , $t ) * ) ;
7
+ object_impl!( $name) ;
12
8
13
- impl <$ ( $t ) , * > $crate:: INSObject for $name<$ ( $t ) , * > {
9
+ impl $crate:: INSObject for $name {
14
10
fn class( ) -> & ' static :: objc:: runtime:: Class {
15
11
let name = stringify!( $name) ;
16
12
match :: objc:: runtime:: Class :: get( name) {
@@ -20,23 +16,23 @@ macro_rules! object_struct {
20
16
}
21
17
}
22
18
23
- impl <$ ( $t ) , * > :: std:: cmp:: PartialEq for $name<$ ( $t ) , * > {
24
- fn eq( & self , other: & $name<$ ( $t ) , * > ) -> bool {
19
+ impl :: std:: cmp:: PartialEq for $name {
20
+ fn eq( & self , other: & Self ) -> bool {
25
21
use $crate:: INSObject ;
26
22
self . is_equal( other)
27
23
}
28
24
}
29
25
30
- impl <$ ( $t ) , * > :: std:: cmp:: Eq for $name<$ ( $t ) , * > { }
26
+ impl :: std:: cmp:: Eq for $name { }
31
27
32
- impl <$ ( $t ) , * > :: std:: hash:: Hash for $name<$ ( $t ) , * > {
28
+ impl :: std:: hash:: Hash for $name {
33
29
fn hash<H >( & self , state: & mut H ) where H : :: std:: hash:: Hasher {
34
30
use $crate:: INSObject ;
35
31
self . hash_code( ) . hash( state) ;
36
32
}
37
33
}
38
34
39
- impl <$ ( $t ) , * > :: std:: fmt:: Debug for $name<$ ( $t ) , * > {
35
+ impl :: std:: fmt:: Debug for $name {
40
36
fn fmt( & self , f: & mut :: std:: fmt:: Formatter ) -> :: std:: fmt:: Result {
41
37
use $crate:: { INSObject , INSString } ;
42
38
:: std:: fmt:: Debug :: fmt( self . description( ) . as_str( ) , f)
0 commit comments