3 ms·
The entire point of passing in a String, according to the article, is to "force you to be aware that you will have to allocate". But you're saying that an extr
by Dylan16807 5y ago
The entire point of passing in a String, according to the article, is to "force you to be aware that you will have to allocate".
But you're saying that an extra hidden allocation doesn't matter and you shouldn't have a "hangup" about it? Trying to follow the same rules as the article seems reasonable to me, not a "hangup".
- Arnavion 5y ago>But you're saying that an extra hidden allocation doesn't matter and you shouldn't have a "hangup" about it? No. I recommend reading the subthread the comment was made in more carefully.
- Dylan16807 5y agoThe comment you replied to was talking both about the negatives of hidden allocations and about purity, so I thought you were addressing both. If you are only talking about purity then okay I have no comment.
- Arnavion 5y ago>The comment you replied to was talking both about the negatives of hidden allocations and about purity That is incorrect. The comment was requesting that `Add::add(String, &str) -> String` should be impled by creating a new String instead of mutating an existing one. My comment pointed out why this request was meaningless.