Experience programmer. Moderator of the human-managed news scraper @nitrofuel

  • 1 Post
  • 0 Comments
Joined 1Y ago
cake
Cake day: Jun 24, 2023

help-circle
rss
Problems with borrowing Traits
Hi everybody, I'm new to Rust. So, I have a struct `Panel` which contains a data `widget` which implements the trait `Widget` I have to implement a function for `Panel` that uses another function that requires a type that implements `Widget`. I tried `Box<T>`, `Rc<T>`, `Box<dyn Widget`, `&T`, but nothing, always compiler errors. How can I fix this?
fedilink