I have a pointer to an u64
value and I can't read it. I am getting this error:
error[E0507]: cannot move out of borrowed content
--> /home/niko/sub/substrate/srml/system/src/lib.rs:533:32
|
533 | let mut aid: T::AccountId = *copy_who;
| ^^^^^^^^^
| |
| cannot move out of borrowed content
| help: consider removing the `*`: `copy_who`
How does one get around "borrowed content" error? What is the point of having a pointer to a variable if you can't read anything that it points to?
impl<T: Trait> Module<T> {
// getter for AccountId
pub fn get_account_id(who: &T::AccountId) -> T::AccountId {
let mut copy_who: &T::AccountId = who;
{
let mut aid: T::AccountId = *copy_who;
return aid;
}
}
}
AccountId
is defined like this:
type AccountId = u64;