From a2b4273589ae71a62a9e320d3912c39137c127e9 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Sat, 23 May 2015 17:11:58 -0700 Subject: [PATCH] Fix warnings --- src/view/dialog.rs | 2 +- src/view/key_event_view.rs | 2 +- src/view/shadow_view.rs | 15 ++++++--------- src/view/stack_view.rs | 10 ---------- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/view/dialog.rs b/src/view/dialog.rs index adea002..4175394 100644 --- a/src/view/dialog.rs +++ b/src/view/dialog.rs @@ -5,7 +5,7 @@ use ncurses; use color; use ::{Cursive,Margins}; use event::EventResult; -use view::{View,ViewPath,SizeRequest,DimensionRequest}; +use view::{View,SizeRequest,DimensionRequest}; use view::{Button,SizedView}; use vec::Vec2; use printer::Printer; diff --git a/src/view/key_event_view.rs b/src/view/key_event_view.rs index d82d878..ffe38b1 100644 --- a/src/view/key_event_view.rs +++ b/src/view/key_event_view.rs @@ -3,7 +3,7 @@ use std::rc::Rc; use ::Cursive; use event::{EventResult,Callback}; -use super::{View,ViewPath,ViewWrapper}; +use super::{View,ViewWrapper}; /// A simple wrapper view that catches some ignored event from its child. /// diff --git a/src/view/shadow_view.rs b/src/view/shadow_view.rs index ca0fb82..199117f 100644 --- a/src/view/shadow_view.rs +++ b/src/view/shadow_view.rs @@ -29,15 +29,12 @@ impl ViewWrapper for ShadowView { fn wrap_draw(&mut self, printer: &Printer, focused: bool) { - { - printer.with_style(color::PRIMARY, |printer| { - // Draw the view background - for y in 1..printer.size.y-1 { - printer.print_hline((1,y), printer.size.x-2, ' ' as u64); - } - }); - } - + printer.with_style(color::PRIMARY, |printer| { + // Draw the view background + for y in 1..printer.size.y-1 { + printer.print_hline((1,y), printer.size.x-2, ' ' as u64); + } + }); self.view.draw(&printer.sub_printer(Vec2::new(1,1), printer.size - (2,2)), focused); diff --git a/src/view/stack_view.rs b/src/view/stack_view.rs index fffd5f2..3719bee 100644 --- a/src/view/stack_view.rs +++ b/src/view/stack_view.rs @@ -1,7 +1,6 @@ use std::cmp::max; use std::any::Any; -use color; use vec::Vec2; use view::{View,SizeRequest,DimensionRequest,Selector,ShadowView}; use event::EventResult; @@ -47,10 +46,6 @@ impl View for StackView { let size = v.size; let offset = (printer.size - size) / 2; v.view.draw(&printer.sub_printer(offset, size), focused); - - - - // v.view.draw(&printer.sub_printer(offset, v.size), focused); } } @@ -69,11 +64,6 @@ impl View for StackView { for layer in self.layers.iter_mut() { layer.size = Vec2::min(size, layer.view.get_min_size(req)); layer.view.layout(layer.size); - - let h = layer.size.y as i32; - let w = layer.size.x as i32; - let x = (size.x as i32 - w) / 2; - let y = (size.y as i32 - h) / 2; } }