logoalt Hacker News

tyushktoday at 1:52 AM1 replyview on HN

In Rust, wouldn't implementing BitOr for Fn/FnOnce/FnMut violate the orphan rule?


Replies

wavemodetoday at 2:28 AM

I'm envisioning that in Rust (and Python), the operator overload would be on a class/struct. It would be the macro/decorator (the same one that adds logging) which would turn the function definition into an object that implements Fn.