From d3669814b511ae3d3bccd3ae23293c6e3d41cdb0 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Mon, 27 Mar 2017 13:27:50 -0700 Subject: [PATCH] Fix warnings * Allow dead code for curses-only utf8 module * Remove intermediate variable in IdView --- src/utf8.rs | 2 ++ src/views/id_view.rs | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utf8.rs b/src/utf8.rs index 7bcfdca..f60ca34 100644 --- a/src/utf8.rs +++ b/src/utf8.rs @@ -6,6 +6,7 @@ use std::char::from_u32; /// function to get more if needed. /// /// Returns an error if the stream is invalid utf-8. +#[allow(dead_code)] pub fn read_char(first: u8, next: F) -> Result where F: Fn() -> Option { @@ -46,6 +47,7 @@ pub fn read_char(first: u8, next: F) -> Result } // Returns a simple bitmask with n 1s to the right. +#[allow(dead_code)] fn make_mask(n: usize) -> u8 { let mut r = 0u8; for i in 0..n { diff --git a/src/views/id_view.rs b/src/views/id_view.rs index 81e2b64..3ef6c5e 100644 --- a/src/views/id_view.rs +++ b/src/views/id_view.rs @@ -64,11 +64,10 @@ impl ViewWrapper for IdView { fn wrap_call_on_any<'a>(&mut self, selector: &Selector, mut callback: Box FnMut(&'b mut Any) + 'a>) { - let result = match selector { + match selector { &Selector::Id(id) if id == self.id => callback(self), s => self.view.borrow_mut().call_on_any(s, callback), - }; - result + } } fn wrap_focus_view(&mut self, selector: &Selector) -> Result<(), ()> {