From 57dd437ae12e479b451456a168eef4b5f1d6251b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 20 Apr 2023 16:49:16 +0100 Subject: [PATCH] Revert "Breaks inference" This reverts commit e26de1f788f5e2493ecd6a30c9c6e1ef14084071. --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 802c5d1..3b6259c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,11 +5,11 @@ pub trait Callable: Any { type Output; fn callable_call(self, a: Args) -> Self::Output; } -impl Callable<(A,)> for fn(A) -> O { +impl Callable<(A,)> for F where F: Fn(A) -> O + 'static { type Output = O; fn callable_call(self, (a,): (A,)) -> O { (self)(a) } } -impl Callable<(A,B)> for fn(A,B) -> O { +impl Callable<(A,B)> for F where F: Fn(A,B) -> O + 'static { type Output = O; fn callable_call(self, (a,b): (A,B)) -> O { (self)(a,b) } } -- 2.30.2