Warning
This post was published 109 days ago. The information described in this article may have changed.
Hi all, I would really appreciate it if someone could take a look at the code below and tell me why the code doesn't work? Also what can I do to get this to work.
Short summary of what I am trying to achieve:
SomeTrait
Bar
which contains a field data
which is HashMap<String, Box>I am writing a method get<T>
for Bar
which should access the stored value and return Option<&T>
Following is the example code I have:
EDIT: Fixed the link
So my question is if there is an ideal way to fix this? Preferably by not creating a new owned value?
7 posts - 5 participants
🏷️ rust_feed