Can't derive Copy because of String?

On formatting, yes Discourse does markdown, so the easier way to do a code/monospace block is three backticks ``` above and below it.

That error message is not recommending that you should implement Copy. Since your type contains a String, the lack of a Copy implementation is clearly legitimate, and you need to do something else.

Unfortunately there's no way for us to know what the right solution would be without seeing your code. But, you should definitely read that chapter of The Book I linked because it explains all the ownership rules this error message is referring to. And that's a subject you really need to understand to be productive in Rust.

1 Like