Currently if there is invalid data entered into the view!() macro the below error shows up at #[widget]
65 | #[widget]
| ^^^^^^^^^
|
= help: message: should be an ident: Error("expected identifier")
Ideally this error should highlight the invalid data.
Or the error message could be clarified that the unexpected identifier is in the view macro. Since a large quantity of code can be in the impl block below #[widget]
This invalid data could include like show below if you put an if statement.
#[widget]
impl Widget for Win {
// misc code here
// .....
view!(){
gtk::Entry {
editable: self.model.publish_path_generate.eq(&false).to_owned(),
if &self.model.publish_path_generate{
text: &self.model.publish_path,
} else {
text: &self.publish_path_custom,
}
changed(entry) => {
let text = entry.text().to_string();
Msg::TextEntered(text, TextInputFields::PublishPath)
},
},
}
}
Currently if there is invalid data entered into the
view!()
macro the below error shows up at#[widget]
Ideally this error should highlight the invalid data. Or the error message could be clarified that the unexpected identifier is in the view macro. Since a large quantity of code can be in the
impl
block below#[widget]
This invalid data could include like show below if you put an if statement.