diff --git a/src/views/on_event_view.rs b/src/views/on_event_view.rs index c5a5510..6fd13eb 100644 --- a/src/views/on_event_view.rs +++ b/src/views/on_event_view.rs @@ -42,7 +42,7 @@ use view::{View, ViewWrapper}; /// .on_event(event::Key::Esc, |s| s.quit()); /// ``` pub struct OnEventView { - inner: T, + view: T, callbacks: HashMap>, } @@ -72,7 +72,7 @@ impl OnEventView { /// Wraps the given view in a new OnEventView. pub fn new(view: T) -> Self { OnEventView { - inner: view, + view: view, callbacks: HashMap::new(), } } @@ -206,7 +206,7 @@ impl OnEventView { } impl ViewWrapper for OnEventView { - wrap_impl!(self.inner: T); + wrap_impl!(self.view: T); fn wrap_on_event(&mut self, event: Event) -> EventResult { let action = self.callbacks.get(&event).cloned(); @@ -217,12 +217,12 @@ impl ViewWrapper for OnEventView { if pre_child { action - .and_then(|a| (*a.callback)(&mut self.inner)) - .unwrap_or_else(|| self.inner.on_event(event)) + .and_then(|a| (*a.callback)(&mut self.view)) + .unwrap_or_else(|| self.view.on_event(event)) } else { - self.inner.on_event(event).or_else(|| { + self.view.on_event(event).or_else(|| { action - .and_then(|a| (*a.callback)(&mut self.inner)) + .and_then(|a| (*a.callback)(&mut self.view)) .unwrap_or(EventResult::Ignored) }) }