callbacks: global_state: compiler sanitization

* use unspecific lifetimes

Signed-off-by: Ralf Zerres <ralf.zerres@networkx.de>
This commit is contained in:
2020-07-03 01:04:21 +02:00
parent 58045967cb
commit d0a5013b71

View File

@@ -16,7 +16,7 @@ use orbtk::prelude::*;
/// Provides generic methods to handle states of datatypes (e.g. used in `PolicyList`).
pub trait GlobalState {
/// Navigates to the given entity.
fn navigate(&self, to: Entity, ctx: &mut Context) {
fn navigate(&self, to: Entity, ctx: &mut Context<'_>) {
if let Some(old_focused_element) = ctx.window().get::<Global>("global").focused_widget {
let mut old_focused_element = ctx.get_widget(old_focused_element);
old_focused_element.set("focused", false);
@@ -28,7 +28,7 @@ pub trait GlobalState {
}
/// Get the text of a widget.
fn get_text(&self, ctx: &mut Context, entity: Entity) -> Option<String> {
fn get_text(&self, ctx: &mut Context<'_>, entity: Entity) -> Option<String> {
let mut widget = ctx.get_widget(entity);
let entry = widget.get_mut::<String>("text");