Hi,
I'm getting a bit confused how Arc
is handled in my situation.
I calling serving function with Arc to my struct as such:
src/rpc.rs
....
{
let storage = storage.clone();
io.add_method("emerald_unhideAccount", move |p: Params| {
wrapper(serves::unhide_account(parse(p)?, &storage))
});
}
....
src/servers.rs
....
pub fn unhide_account<T>(
params: Either<(UnhideAccountAccount,), (UnhideAccountAccount, CommonAdditional)>,
storage: &Arc<T>,
) -> Result<bool, Error>
where
T: KeyfileStorage,
{...}
....
It compiles now, but I wonder why when there was PathBuf
wrapped inside Arc
one doesn't need to specify &Arc<>
for unhide_account
fuction, just &PathBuf worked ?