Skip to content

Commit 0a6df20

Browse files
committed
Rename MethodImplementation's associated types
1 parent ff33337 commit 0a6df20

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

crates/objc2/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4545
* Relaxed the requirements for receivers in `MethodImplementation`; now,
4646
anything that implements `MessageReceiver` can be used as the receiver of
4747
a method.
48+
* **BREAKING**: Renamed the associated types `Ret` and `Args` on
49+
`MethodImplementation` to `Return` and `Arguments`.
4850

4951
### Deprecated
5052
* Soft deprecated using `msg_send!` without a comma between arguments (i.e.

crates/objc2/src/declare/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ impl ClassBuilder {
241241
/// `-release` used by ARC, will not be present otherwise.
242242
pub fn root<F>(name: &str, intitialize_fn: F) -> Option<Self>
243243
where
244-
F: MethodImplementation<Callee = AnyClass, Args = (), Ret = ()>,
244+
F: MethodImplementation<Callee = AnyClass, Arguments = (), Return = ()>,
245245
{
246246
Self::with_superclass(name, None).map(|mut this| {
247247
unsafe { this.add_class_method(sel!(initialize), intitialize_fn) };
@@ -274,8 +274,8 @@ impl ClassBuilder {
274274
unsafe {
275275
self.add_method_inner(
276276
sel,
277-
F::Args::ENCODINGS,
278-
&F::Ret::ENCODING_RETURN,
277+
F::Arguments::ENCODINGS,
278+
&F::Return::ENCODING_RETURN,
279279
func.__imp(),
280280
)
281281
}
@@ -338,8 +338,8 @@ impl ClassBuilder {
338338
unsafe {
339339
self.add_class_method_inner(
340340
sel,
341-
F::Args::ENCODINGS,
342-
&F::Ret::ENCODING_RETURN,
341+
F::Arguments::ENCODINGS,
342+
&F::Return::ENCODING_RETURN,
343343
func.__imp(),
344344
)
345345
}

crates/objc2/src/runtime/method_implementation.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ mod private {
1919
pub trait MethodImplementation: private::Sealed + Sized {
2020
/// The callee type of the method.
2121
type Callee: ?Sized + RefEncode;
22-
/// The return type of the method.
23-
type Ret: EncodeReturn;
22+
2423
/// The argument types of the method.
25-
type Args: EncodeArguments;
24+
type Arguments: EncodeArguments;
25+
26+
/// The return type of the method.
27+
type Return: EncodeReturn;
2628

2729
#[doc(hidden)]
2830
fn __imp(self) -> Imp;
@@ -44,8 +46,8 @@ macro_rules! method_impl_inner {
4446
$($t: EncodeArgument,)*
4547
{
4648
type Callee = T::__Inner;
47-
type Ret = R;
48-
type Args = ($($t,)*);
49+
type Arguments = ($($t,)*);
50+
type Return = R;
4951

5052
fn __imp(self) -> Imp {
5153
// SAFETY: Transmuting to an `unsafe` function pointer
@@ -66,8 +68,8 @@ macro_rules! method_impl_inner {
6668
$($t: EncodeArgument,)*
6769
{
6870
type Callee = T;
69-
type Ret = IdReturnValue;
70-
type Args = ($($t,)*);
71+
type Arguments = ($($t,)*);
72+
type Return = IdReturnValue;
7173

7274
fn __imp(self) -> Imp {
7375
// SAFETY: `Allocated<T>` is the same as `NonNull<T>`, except

0 commit comments

Comments
 (0)