So let's see how we can rewrite your solution in rust