functional stuff in rust