remove unneeded mutability modifier

master
Ales Katona 5 years ago
parent 21ac0d52c1
commit 9f6e7bbe7f
Signed by: almindor
GPG Key ID: 08C459E2D8ABB7E8

@ -1,6 +1,6 @@
[package]
name = "prongs"
version = "0.0.3"
version = "0.0.4"
authors = ["Ales Katona <almindor@gmail.com>"]
edition = "2018"
readme = "README.md"

@ -33,7 +33,7 @@ where TUserAction: Clone + Serialize,
self.schema.clear_assignments();
}
pub fn process_event(&mut self, event: &Event) -> Option<ProcessingResult<TUserAction>> {
pub fn process_event(&self, event: &Event) -> Option<ProcessingResult<TUserAction>> {
self.schema.process_event(event)
}

@ -41,7 +41,7 @@ where TUserAction: Clone + Serialize,
/// Main event processing hook. Will result in ProcessingResult for user's action if
/// a mapping is withing the schema for the given event.
pub fn process_event(&mut self, event: &Event) -> Option<ProcessingResult<TUserAction>> {
pub fn process_event(&self, event: &Event) -> Option<ProcessingResult<TUserAction>> {
self.schema.process_event(event)
}

@ -132,7 +132,7 @@ where TEventType: ToEventType<TControllerID>,
/// Main processing loop. Takes input event and returns an option with processing result
/// If the mapping was found result will be set, otherwise None
fn process_event(&mut self, event: &TEventType) -> Option<ProcessingResult<TUserAction>> {
fn process_event(&self, event: &TEventType) -> Option<ProcessingResult<TUserAction>> {
if let Some(event_type) = event.to_raw() {
if let Some(action) = self.keymap.get(&event_type) {
if self.controller_id.is_some() && self.controller_id != event.controller_id() {

Loading…
Cancel
Save