How to compose functions in Rust?
As @ljedrz points out, to make it work you only need to reference the composed functions again: let finally = compose(&*multiply_and_add, &*divide_and_subtract); (Note that in Rust, convention dictates that variable names should be in snake_case) However, we can make this better! Since Rust 1.26, we can use abstract return types (previously featured gated as #![feature(conservative_impl_trait)]). … Read more