Can you write the equivalent of the above code in Rust please? Is the use of pointers still advisable for the Rust code?