```error: implementation of iced::application::View is not general enough
--> src/main.rs:262:5
|
262 | iced::run("main", MyApp::update, |arg0: &MyApp| MyApp::view(&mut *arg0))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of iced::application::View is not general enough
|
= note: {closure@src/main.rs:262:38: 262:52} must implement iced::application::View<'0, MyApp, Message, MyTheme, iced_renderer::fallback::Renderer<iced_wgpu::Renderer, iced_tiny_skia::Renderer>>, for any lifetime '0...
= note: ...but it actually implements iced::application::View<'1, MyApp, Message, MyTheme, iced_renderer::fallback::Renderer<iced_wgpu::Renderer, iced_tiny_skia::Renderer>>, for some specific lifetime '1
fn main() -> iced::Result {
iced::run(..., |arg0: &MyApp| MyApp::view(&mut *arg0))
}```
fn view(&mut self) -> iced::Element<'_, Message, MyTheme>{
let grid: Grid<GridMessage, MyTheme> = Grid::new(
self.grid.rows_mut_iter().map(|row| RowData {
cells: std::mem::take(&mut row.cells), // Move `cells` instead of cloning
}),
container::Style {
background: Some(Background::Color(Color::WHITE)),
..Default::default()
},
|_offset: iced::widget::scrollable::AbsoluteOffset| GridMessage::Sync,
400.0,
400.0,
Size::new(100.0, 100.0),
MyTheme::Main
);
iced::Element::new(Wrapper {
content: Box::new(&self.grid),
target: Style,
theme: self.grid.theme.clone(),
style: self.grid.style,
})
}```
Repo:
https://github.com/SpiderUnderUrBed/iced-calendar-rs/tree/testing
My relevent library (I am working on it, so i am willing to make changes, the whole calender thing is a proof of concept):
https://github.com/SpiderUnderUrBed/iced_grid/tree/testing2