Get Option from Vec by index without moving

⚓ rust    📅 2025-04-24    👤 surdeus    👁️ 4      

surdeus

Hello! I've created a play for my program

Briefly: I have a Vec<Option<Box<dyn SomeTrait>>> and want to get an element by index to send it to a function. And I don't wanna to take this element - the source Vec should be untouched. How can I do this?

6 posts - 4 participants

Read full topic

🏷️ rust_feed