#![feature(unboxed_closures, fn_traits)] use fn_overloads::fn_overloads; use std::{ops::Mul, str::FromStr}; fn_overloads! { fn double { >(value: &str) -> Option { Some(value.parse::().ok()? * 2) } } } struct CustomMul; impl Mul<&'static str> for CustomMul { type Output = String; fn mul(self, rhs: &'static str) -> Self::Output { rhs.to_string() } } fn main() { double("asdf"); }