Skip to content

Instantly share code, notes, and snippets.

fn test_closure_recursive() {
struct Fact<'s> {
f: &'s Fn(&Fact, u32) -> u32,
}
impl<'s> Fact<'s> {
pub fn call(&self, i: u32) -> u32 {
(self.f)(&self, i)
}
}