by micouay on 3/19/22, 1:37 PM with 1 comments
by ankurdhama on 3/19/22, 1:47 PM
You have to understand the difference between a move and a copy. "let b = a" can have 2 meaning - either copy a value to b if a supports copy or move the value a to b and now you cannot use a anymore. Similarly if you did "let a = *b" (where b is a reference) you are doing either a move or a copy depending on b's type. If b doesnt support copy then this will fail to compile as you are trying to move from a reference which is not possible as moving requires ownership of the value and the reference only borrowed it.