Closed divyaranjan1905 closed 1 month ago
I am confused. mut
is also in the exercise:
Am I missing something?
I think I messed it up and then forgot that mut was already there, apologies for not double-checking. It's all good. Thank you for rustlings.
No problem. You are welcome :D
The problem in
move_semnatic5.rs
specifically mentions:This means, one must not do anything other than just adding &. But, the corresponding solution to it in is the following: https://github.com/rust-lang/rustlings/blame/ce3dcc98560a7555386556ba13d5e901bb27e2ed/solutions/06_move_semantics/move_semantics5.rs#L11
The solution adds a new
mut
to thedata
argument of the function, this is not a valid solution according to the question. I know this resolves the compiler errors and it works smoothly, but it is not correct with respect to the problem that has been posed.