linter updates

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2021-11-12 15:48:17 +01:00
parent c1a4547261
commit c8f6a6d272
36 changed files with 1005 additions and 614 deletions

View File

@@ -21,7 +21,7 @@ pub struct SenderState {
// actions
actions: Vec<SenderAction>,
// entity that will receive the message
target: Entity
target: Entity,
}
/// Method definitions, we provide inside the `SenderState`.
@@ -38,8 +38,11 @@ impl State for SenderState {
// initialize the view entities
fn init(&mut self, _registry: &mut Registry, ctx: &mut Context) {
// create the target entity, that receives the Sender messages
self.target = Entity::from(ctx.widget().try_clone::<u32>("target")
.expect("ERROR: SenderState::init(): target entity not found!"));
self.target = Entity::from(
ctx.widget()
.try_clone::<u32>("target")
.expect("ERROR: SenderState::init(): target entity not found!"),
);
}
// update entities, before we render the view

View File

@@ -16,8 +16,7 @@ widget!(SenderView<SenderState> {
impl Template for SenderView {
fn template(self, id: Entity, bc: &mut BuildContext) -> Self {
self.name("SenderView")
.child(
self.name("SenderView").child(
Button::new()
.text("Click me to send a message!")
.v_align("center")
@@ -28,7 +27,7 @@ impl Template for SenderView {
//ctx.send_message(TestMessageAction::ToggleMessageBox, id);
false
})
.build(bc)
.build(bc),
)
}
}