3 ms·
Well, you wouldn't. The example function in the blog post isn't mutating the argument, but that's why the comment says // This uses mut for no reason other t
by eridius 9y ago
Well, you wouldn't. The example function in the blog post isn't mutating the argument, but that's why the comment says
// This uses mut for no reason other than to prove a point.
You wouldn't normally have a function accept a mutable reference if it's not mutating it.
- jackmott 9y agoit would be a compiler warning if you did, too.