I clearly didn't fully grasp #rust ownership yet. I get that the variable "components" has been moved, but how can I circumvent this? I can't borrow here, since I collect into a String, or at least that's what I think I have to do. Any hints?

Follow

@garritfra what does line start as? Chars are also not always what you expect so iterating across them may explode if a line contains non-ascii characters. Since it appears you’re consuming parts of a String to get op and value perhaps it makes sense to use &str slices directly and make a String for each value from those?

Sign in to participate in the conversation
Librem Social

Librem Social is an opt-in public network. Messages are shared under Creative Commons BY-SA 4.0 license terms. Policy.

Stay safe. Please abide by our code of conduct.

(Source code)

image/svg+xml Librem Chat image/svg+xml