Computing a prime table in Rust
Returning an iterator is fairly easy with impl. Here's how you can do it. Note that you need to use move with the closure so that it takes ownership of i. Since u32 can be copied, this just copies it instead of taking a reference, which lets you avoid dealing with lifetimes on the return type.

fn get_multiples(i: u32, max: u32) -&gt; impl Iterator&lt;Item = u32&gt; {
    let max_multiplier = max / i;
    (2..=max_multiplier).map(move |n| i * n)
}


As another note, I have a recommendation for improving performance on your sieve. Currently, every time you call remove_item, you have to search all the way through the vector, remove the item, then shift all items after it forward by one. This is awful for performance. Instead, you could have a Vec&lt;bool&gt; and simply flip the value based on index rather than remove it. Then when you're done sieving, you can go through this vector along with indices and create a Vec&lt;u32&gt; to return.