Skip to content

Commit 6290f42

Browse files
authored
Return type: remove one stage of the specialization (#5673)
1 parent 5fcc5d7 commit 6290f42

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/impl_/wrap.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,17 @@ impl<T> SomeWrap<T> for Option<T> {
2121
}
2222
}
2323

24-
// Hierarchy of conversions used in the `IntoPy` implementation
24+
// Hierarchy of conversions used in the function return type machinery
2525
pub struct Converter<T>(EmptyTupleConverter<T>);
2626
pub struct EmptyTupleConverter<T>(IntoPyObjectConverter<T>);
27-
pub struct IntoPyObjectConverter<T>(IntoPyConverter<T>);
28-
pub struct IntoPyConverter<T>(UnknownReturnResultType<T>);
27+
pub struct IntoPyObjectConverter<T>(UnknownReturnResultType<T>);
2928
pub struct UnknownReturnResultType<T>(UnknownReturnType<T>);
3029
pub struct UnknownReturnType<T>(PhantomData<T>);
3130

3231
pub fn converter<T>(_: &T) -> Converter<T> {
33-
Converter(EmptyTupleConverter(IntoPyObjectConverter(IntoPyConverter(
32+
Converter(EmptyTupleConverter(IntoPyObjectConverter(
3433
UnknownReturnResultType(UnknownReturnType(PhantomData)),
35-
))))
34+
)))
3635
}
3736

3837
impl<T> Deref for Converter<T> {
@@ -50,13 +49,6 @@ impl<T> Deref for EmptyTupleConverter<T> {
5049
}
5150

5251
impl<T> Deref for IntoPyObjectConverter<T> {
53-
type Target = IntoPyConverter<T>;
54-
fn deref(&self) -> &Self::Target {
55-
&self.0
56-
}
57-
}
58-
59-
impl<T> Deref for IntoPyConverter<T> {
6052
type Target = UnknownReturnResultType<T>;
6153
fn deref(&self) -> &Self::Target {
6254
&self.0

0 commit comments

Comments
 (0)