I've created a structure:
struct ThreadCommands {
control_tx: [Option<Sender<ControlCommand>>;8],
draw_rx: [Option<Receiver<DrawCommand>>;8]
}
When I try to initialize it:
let mut control = ThreadCommands {
control_tx: [None;8],
draw_rx: [None;8]
};
I get an error:
the trait bound
std::option::Option<std::sync::mpsc::Sender>: std::marker::Copy is not satisfied
Can someone explain me, why Copy is needed here? And if I can't provide a Copy, how can I initialize this structure?
(Or, may be, I miss something obvious here).
Update: This works:
ThreadCommands {
control_tx: [None,None,None,None, None,None,None,None],
draw_rx: [None,None,None,None, None,None,None,None]
}
But it looks like a mockery. Are compiler that stupid?