Convert &A to &[A]?

Hello,

Let's say I have some type, for example

struct Cell { 
  dna: String 
}

Further, I have this trait:

trait Living {
  fn cells(&self) -> &[Cell]
}

Now I want Cell to implement Living. But how do I implement cells? How can I get a &[Cell] from &self, which is &Cell?

Thanks!

Best, Oliver

10 Likes

Awesome, thanks!