Skip to content

Commit 44d2c20

Browse files
committed
Simplify __declare_class_register_out!
1 parent 4fb770b commit 44d2c20

File tree

1 file changed

+3
-40
lines changed

1 file changed

+3
-40
lines changed

crates/objc2/src/macros/declare_class.rs

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,6 @@ macro_rules! __convert_result {
11781178
#[doc(hidden)]
11791179
#[macro_export]
11801180
macro_rules! __declare_class_register_out {
1181-
// #[method(...)]
11821181
{
11831182
($builder:ident)
11841183
($($qualifiers:tt)*)
@@ -1192,51 +1191,15 @@ macro_rules! __declare_class_register_out {
11921191
($($__params_prefix:tt)*)
11931192
($($params_rest:tt)*)
11941193

1195-
(#[method($($sel:tt)*)])
1196-
()
1197-
($($m_optional:tt)*)
1198-
($($m_checked:tt)*)
1199-
} => {
1200-
$crate::__extract_and_apply_cfg_attributes! {
1201-
($($m_checked)*)
1202-
1203-
$crate::__declare_class_invalid_selectors!(#[method($($sel)*)]);
1204-
$crate::__extern_methods_no_optional!($($m_optional)*);
1205-
1206-
$builder.$builder_method(
1207-
$crate::sel!($($sel)*),
1208-
Self::$name as $crate::__fn_ptr! {
1209-
($($qualifiers)*)
1210-
(_, _,)
1211-
$($params_rest)*
1212-
},
1213-
);
1214-
}
1215-
};
1216-
1217-
// #[method_id(...)]
1218-
{
1219-
($builder:ident)
1220-
($($qualifiers:tt)*)
1221-
($name:ident)
1222-
($($__ret:ty)?)
1223-
($__body:block)
1224-
1225-
($builder_method:ident)
1226-
($__receiver:expr)
1227-
($__receiver_ty:ty)
1228-
($($__params_prefix:tt)*)
1229-
($($params_rest:tt)*)
1230-
1231-
(#[method_id($($sel:tt)*)])
1232-
() // Retain semantics unsupported in declare_class!
1194+
(#[$method_or_method_id:ident($($sel:tt)*)])
1195+
($($retain_semantics:tt)*)
12331196
($($m_optional:tt)*)
12341197
($($m_checked:tt)*)
12351198
} => {
12361199
$crate::__extract_and_apply_cfg_attributes! {
12371200
($($m_checked)*)
12381201

1239-
$crate::__declare_class_invalid_selectors!(#[method_id($($sel)*)]);
1202+
$crate::__declare_class_invalid_selectors!(#[$method_or_method_id($($sel)*)]);
12401203
$crate::__extern_methods_no_optional!($($m_optional)*);
12411204

12421205
$builder.$builder_method(

0 commit comments

Comments
 (0)