rust & and deref
&(s.to_string() + v);
L________| stored on the heap
L______|append str v
L__________| this is heap ponter or heap,the “&” means get the address of in the cC language—pinter ,as same as in the rust substantially,stored in the stack,so ,lifetime end at next “}”.
so,take the value to use * or deref().
rust & and deref
于 2022-06-16 20:41:14 首次发布