From 4c00dd3b7210167026a06b82f1b91c909ef67cf5 Mon Sep 17 00:00:00 2001 From: Alexandre Bury Date: Mon, 6 Jan 2020 15:51:38 -0800 Subject: [PATCH] Directly use crate::Vec2 --- examples/logs.rs | 2 +- examples/mines/game.rs | 2 +- examples/mines/main.rs | 2 +- src/backend/blt.rs | 2 +- src/backend/crossterm.rs | 3 +-- src/backend/curses/n.rs | 2 +- src/backend/curses/pan.rs | 2 +- src/backend/dummy.rs | 2 +- src/backend/mod.rs | 2 +- src/backend/puppet/mod.rs | 2 +- src/backend/puppet/static_values.rs | 2 +- src/backend/termion.rs | 2 +- src/cursive.rs | 2 +- src/direction.rs | 2 +- src/event.rs | 2 +- src/printer.rs | 2 +- src/rect.rs | 2 +- src/vec.rs | 32 ++++++++++++++--------------- src/view/margins.rs | 2 +- src/view/position.rs | 4 ++-- src/view/resizable.rs | 2 +- src/view/scroll/core.rs | 2 +- src/view/scroll_base.rs | 2 +- src/view/size_cache.rs | 2 +- src/view/view_trait.rs | 2 +- src/view/view_wrapper.rs | 2 +- src/views/button.rs | 2 +- src/views/canvas.rs | 2 +- src/views/checkbox.rs | 2 +- src/views/debug_view.rs | 2 +- src/views/dialog.rs | 2 +- src/views/edit_view.rs | 2 +- src/views/hideable_view.rs | 2 +- src/views/last_size_view.rs | 2 +- src/views/linear_layout.rs | 2 +- src/views/list_view.rs | 2 +- src/views/menu_popup.rs | 2 +- src/views/menubar.rs | 2 +- src/views/padded_view.rs | 2 +- src/views/panel.rs | 2 +- src/views/radio.rs | 2 +- src/views/resized_view.rs | 4 ++-- src/views/select_view.rs | 2 +- src/views/shadow_view.rs | 2 +- src/views/slider_view.rs | 2 +- src/views/stack_view.rs | 2 +- src/views/text_area.rs | 2 +- src/views/tracked_view.rs | 2 +- 48 files changed, 65 insertions(+), 66 deletions(-) diff --git a/examples/logs.rs b/examples/logs.rs index 88f5337..a973423 100644 --- a/examples/logs.rs +++ b/examples/logs.rs @@ -1,5 +1,5 @@ use cursive::traits::*; -use cursive::vec::Vec2; +use cursive::Vec2; use cursive::{Cursive, Printer}; use std::collections::VecDeque; use std::sync::mpsc; diff --git a/examples/mines/game.rs b/examples/mines/game.rs index 472d142..61ec7f2 100644 --- a/examples/mines/game.rs +++ b/examples/mines/game.rs @@ -1,4 +1,4 @@ -use cursive::vec::Vec2; +use cursive::Vec2; use rand::{thread_rng, Rng}; // use std::cmp::max; diff --git a/examples/mines/main.rs b/examples/mines/main.rs index 0da4435..5df855b 100644 --- a/examples/mines/main.rs +++ b/examples/mines/main.rs @@ -3,10 +3,10 @@ mod game; use cursive::direction::Direction; use cursive::event::{Event, EventResult, MouseButton, MouseEvent}; use cursive::theme::{BaseColor, Color, ColorStyle}; -use cursive::vec::Vec2; use cursive::views::{Button, Dialog, LinearLayout, Panel, SelectView}; use cursive::Cursive; use cursive::Printer; +use cursive::Vec2; fn main() { let mut siv = Cursive::default(); diff --git a/src/backend/blt.rs b/src/backend/blt.rs index 6c73048..f502b31 100644 --- a/src/backend/blt.rs +++ b/src/backend/blt.rs @@ -14,7 +14,7 @@ use self::bear_lib_terminal::Color as BltColor; use crate::backend; use crate::event::{Event, Key, MouseButton, MouseEvent}; use crate::theme::{BaseColor, Color, ColorPair, Effect}; -use crate::vec::Vec2; +use crate::Vec2; // Use AHash instead of the slower SipHash type HashSet = std::collections::HashSet; diff --git a/src/backend/crossterm.rs b/src/backend/crossterm.rs index bc8fe9f..7b5bf31 100644 --- a/src/backend/crossterm.rs +++ b/src/backend/crossterm.rs @@ -32,8 +32,7 @@ use crossterm::{ use crate::{ backend, event::{Event, Key, MouseButton, MouseEvent}, - theme, - vec::Vec2, + theme, Vec2, }; #[cfg(windows)] diff --git a/src/backend/curses/n.rs b/src/backend/curses/n.rs index e8bf23f..abd5794 100644 --- a/src/backend/curses/n.rs +++ b/src/backend/curses/n.rs @@ -14,7 +14,7 @@ use crate::backend; use crate::event::{Event, Key, MouseButton, MouseEvent}; use crate::theme::{Color, ColorPair, Effect}; use crate::utf8; -use crate::vec::Vec2; +use crate::Vec2; use self::super::split_i32; use self::ncurses::mmask_t; diff --git a/src/backend/curses/pan.rs b/src/backend/curses/pan.rs index 747e70f..fab6a85 100644 --- a/src/backend/curses/pan.rs +++ b/src/backend/curses/pan.rs @@ -8,7 +8,7 @@ use std::io::{stdout, Write}; use crate::backend; use crate::event::{Event, Key, MouseButton, MouseEvent}; use crate::theme::{Color, ColorPair, Effect}; -use crate::vec::Vec2; +use crate::Vec2; use self::pancurses::mmask_t; use super::split_i32; diff --git a/src/backend/dummy.rs b/src/backend/dummy.rs index f93c8c0..4384926 100644 --- a/src/backend/dummy.rs +++ b/src/backend/dummy.rs @@ -3,7 +3,7 @@ use crate::backend; use crate::event::Event; use crate::theme; -use crate::vec::Vec2; +use crate::Vec2; /// Dummy backend that does nothing and immediately exits. /// diff --git a/src/backend/mod.rs b/src/backend/mod.rs index a950298..69a7cce 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -9,7 +9,7 @@ use crate::event::Event; use crate::theme; -use crate::vec::Vec2; +use crate::Vec2; use unicode_width::UnicodeWidthStr; #[cfg(unix)] diff --git a/src/backend/puppet/mod.rs b/src/backend/puppet/mod.rs index 873eacc..02e3853 100644 --- a/src/backend/puppet/mod.rs +++ b/src/backend/puppet/mod.rs @@ -7,7 +7,7 @@ use crate::backend::puppet::observed::ObservedScreen; use crate::backend::puppet::observed::ObservedStyle; use crate::event::Event; use crate::theme; -use crate::vec::Vec2; +use crate::Vec2; use std::cell::{Cell, RefCell}; use std::rc::Rc; use unicode_segmentation::UnicodeSegmentation; diff --git a/src/backend/puppet/static_values.rs b/src/backend/puppet/static_values.rs index 6dcaef8..377013f 100644 --- a/src/backend/puppet/static_values.rs +++ b/src/backend/puppet/static_values.rs @@ -3,7 +3,7 @@ use lazy_static::lazy_static; use crate::theme::ColorPair; use crate::theme::{Color, Effect}; -use crate::vec::Vec2; +use crate::Vec2; use crate::XY; use enumset::EnumSet; diff --git a/src/backend/termion.rs b/src/backend/termion.rs index eb1d997..4fb8957 100644 --- a/src/backend/termion.rs +++ b/src/backend/termion.rs @@ -19,7 +19,7 @@ use crossbeam_channel::{self, select, Receiver}; use crate::backend; use crate::event::{Event, Key, MouseButton, MouseEvent}; use crate::theme; -use crate::vec::Vec2; +use crate::Vec2; use std::cell::{Cell, RefCell}; use std::fs::File; diff --git a/src/cursive.rs b/src/cursive.rs index 28f7583..ea55fe8 100644 --- a/src/cursive.rs +++ b/src/cursive.rs @@ -11,9 +11,9 @@ use crate::direction; use crate::event::{Callback, Event, EventResult}; use crate::printer::Printer; use crate::theme; -use crate::vec::Vec2; use crate::view::{self, Finder, IntoBoxedView, Position, View}; use crate::views::{self, LayerPosition}; +use crate::Vec2; static DEBUG_VIEW_NAME: &str = "_cursive_debug_view"; diff --git a/src/direction.rs b/src/direction.rs index 180b296..b3efc67 100644 --- a/src/direction.rs +++ b/src/direction.rs @@ -23,7 +23,7 @@ //! `Tab` key would usually cycle focus in the "front" direction, while //! using the arrow keys would use absolute directions instead. -use crate::vec::Vec2; +use crate::Vec2; use crate::XY; /// Describes a vertical or horizontal orientation for a view. diff --git a/src/event.rs b/src/event.rs index 8ad02e3..8a73c34 100644 --- a/src/event.rs +++ b/src/event.rs @@ -12,8 +12,8 @@ //! [`on_event`]: crate::View::on_event //! [global callback]: crate::Cursive::add_global_callback -use crate::vec::Vec2; use crate::Cursive; +use crate::Vec2; use std::any::Any; use std::cell::RefCell; use std::ops::Deref; diff --git a/src/printer.rs b/src/printer.rs index f822540..a74ce35 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -6,8 +6,8 @@ use crate::theme::{ BorderStyle, ColorStyle, Effect, PaletteColor, Style, Theme, }; use crate::utils::lines::simple::{prefix, suffix}; -use crate::vec::Vec2; use crate::with::With; +use crate::Vec2; use enumset::EnumSet; use std::cmp::min; use unicode_segmentation::UnicodeSegmentation; diff --git a/src/rect.rs b/src/rect.rs index 429558e..f3ed61d 100644 --- a/src/rect.rs +++ b/src/rect.rs @@ -1,5 +1,5 @@ //! Rectangles on the 2D character grid. -use crate::vec::Vec2; +use crate::Vec2; use std::ops::Add; /// A non-empty rectangle on the 2D grid. diff --git a/src/vec.rs b/src/vec.rs index dabb867..b5c89a4 100644 --- a/src/vec.rs +++ b/src/vec.rs @@ -38,7 +38,7 @@ impl XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// assert!(Vec2::new(9999, 9999) < Vec2::max_value()); /// ``` pub fn max_value() -> Self { @@ -52,7 +52,7 @@ impl XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// let u = Vec2::new(1, 2); /// let v = Vec2::new(2, 1); /// assert_eq!(u.saturating_sub(v), Vec2::new(0, 1)); @@ -69,7 +69,7 @@ impl XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// # use cursive::XY; /// let u = Vec2::new(1, 2); /// let v = XY::::new(-2, 1); @@ -92,7 +92,7 @@ impl XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// let u = Vec2::new(1, 6); /// let v = Vec2::new(2, 3); /// assert_eq!(u.div_up(v), Vec2::new(1, 2)); @@ -113,7 +113,7 @@ impl XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// let xy = Vec2::new(1, 2); /// assert_eq!(xy.checked_sub((1, 1)), Some(Vec2::new(0, 1))); /// assert_eq!(xy.checked_sub((2, 2)), None); @@ -132,7 +132,7 @@ impl XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// # use cursive::XY; /// let v: XY = Vec2::new(1, 2).signed().map(|i| i - 5); /// assert_eq!(v, XY::new(-4, -3)); @@ -155,7 +155,7 @@ impl XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// let v = Vec2::new(1, 2); /// assert!(v.fits_in((1, 2))); /// assert!(v.fits_in((3, 3))); @@ -175,7 +175,7 @@ impl XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// let v = Vec2::new(1, 2); /// assert!(v.fits((1, 2))); /// assert!(v.fits((0, 0))); @@ -203,7 +203,7 @@ impl XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// assert_eq!(Vec2::max((1, 2), (3, 1)), Vec2::new(3, 2)); /// ``` pub fn max>, B: Into>>(a: A, b: B) -> Self { @@ -217,7 +217,7 @@ impl XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// assert_eq!(Vec2::min((1, 2), (3, 1)), Vec2::new(1, 1)); /// ``` pub fn min>, B: Into>>(a: A, b: B) -> Self { @@ -315,7 +315,7 @@ impl XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// assert_eq!(Vec2::zero(), Vec2::new(0, 0)); /// ``` pub fn zero() -> Self { @@ -350,7 +350,7 @@ where /// /// ```rust /// # use cursive::XY; - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// let u = Vec2::new(1, 2); /// let v: XY = XY::from(u); /// assert_eq!(v, XY::new(1, 2)); @@ -378,7 +378,7 @@ impl From<(u32, u32)> for XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// let v = Vec2::from((1u32, 2u32)); /// assert_eq!(v, Vec2::new(1, 2)); /// ``` @@ -391,7 +391,7 @@ impl From<(u8, u8)> for XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// let v = Vec2::from((1u8, 2u8)); /// assert_eq!(v, Vec2::new(1, 2)); /// ``` @@ -404,7 +404,7 @@ impl From<(u16, u16)> for XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// let v = Vec2::from((1u16, 2u16)); /// assert_eq!(v, Vec2::new(1, 2)); /// ``` @@ -473,7 +473,7 @@ impl Mul for XY { /// # Examples /// /// ```rust - /// # use cursive::vec::Vec2; + /// # use cursive::Vec2; /// let v = Vec2::new(1, 2); /// assert_eq!(v * 2, Vec2::new(2, 4)); /// ``` diff --git a/src/view/margins.rs b/src/view/margins.rs index 878c2cf..a8fbaaf 100644 --- a/src/view/margins.rs +++ b/src/view/margins.rs @@ -1,4 +1,4 @@ -use crate::vec::Vec2; +use crate::Vec2; use std::ops::{Add, Div, Mul, Sub}; /// Four values representing each direction. diff --git a/src/view/position.rs b/src/view/position.rs index 9c61fed..732e6a5 100644 --- a/src/view/position.rs +++ b/src/view/position.rs @@ -1,4 +1,4 @@ -use crate::vec::Vec2; +use crate::Vec2; use crate::XY; use std::cmp::min; @@ -91,7 +91,7 @@ impl Offset { mod tests { use super::Position; - use crate::vec::Vec2; + use crate::Vec2; #[test] fn test_center() { diff --git a/src/view/resizable.rs b/src/view/resizable.rs index 4883aec..5dd3f0e 100644 --- a/src/view/resizable.rs +++ b/src/view/resizable.rs @@ -1,6 +1,6 @@ -use crate::vec::Vec2; use crate::view::{SizeConstraint, View}; use crate::views::ResizedView; +use crate::Vec2; /// Makes a view wrappable in a [`ResizedView`]. pub trait Resizable: View + Sized { diff --git a/src/view/scroll/core.rs b/src/view/scroll/core.rs index f3c0522..1d3deb5 100644 --- a/src/view/scroll/core.rs +++ b/src/view/scroll/core.rs @@ -5,9 +5,9 @@ use crate::event::{AnyCb, Event, EventResult, Key, MouseButton, MouseEvent}; use crate::printer::Printer; use crate::rect::Rect; use crate::theme::ColorStyle; -use crate::vec::Vec2; use crate::view::{ScrollStrategy, Selector, SizeCache}; use crate::with::With; +use crate::Vec2; use crate::XY; /// Describes an item with a scroll core. diff --git a/src/view/scroll_base.rs b/src/view/scroll_base.rs index 4b17c9c..fa32264 100644 --- a/src/view/scroll_base.rs +++ b/src/view/scroll_base.rs @@ -1,7 +1,7 @@ use crate::div::div_up; use crate::theme::ColorStyle; -use crate::vec::Vec2; use crate::Printer; +use crate::Vec2; use std::cmp::{max, min}; /// Provide scrolling functionalities to a view. diff --git a/src/view/size_cache.rs b/src/view/size_cache.rs index 1b7dc56..429716f 100644 --- a/src/view/size_cache.rs +++ b/src/view/size_cache.rs @@ -1,4 +1,4 @@ -use crate::vec::Vec2; +use crate::Vec2; use crate::XY; /// Cache around a one-dimensional layout result. diff --git a/src/view/view_trait.rs b/src/view/view_trait.rs index e7b49d8..066c0cd 100644 --- a/src/view/view_trait.rs +++ b/src/view/view_trait.rs @@ -1,9 +1,9 @@ use crate::direction::Direction; use crate::event::{AnyCb, Event, EventResult}; use crate::rect::Rect; -use crate::vec::Vec2; use crate::view::{AnyView, Selector}; use crate::Printer; +use crate::Vec2; use std::any::Any; /// Main trait defining a view behaviour. diff --git a/src/view/view_wrapper.rs b/src/view/view_wrapper.rs index 6034277..633f10e 100644 --- a/src/view/view_wrapper.rs +++ b/src/view/view_wrapper.rs @@ -1,9 +1,9 @@ use crate::direction::Direction; use crate::event::{AnyCb, Event, EventResult}; use crate::rect::Rect; -use crate::vec::Vec2; use crate::view::{Selector, View}; use crate::Printer; +use crate::Vec2; /// Generic wrapper around a view. /// diff --git a/src/views/button.rs b/src/views/button.rs index 0d1bcb0..c0e4018 100644 --- a/src/views/button.rs +++ b/src/views/button.rs @@ -3,8 +3,8 @@ use crate::direction::Direction; use crate::event::*; use crate::rect::Rect; use crate::theme::ColorStyle; -use crate::vec::Vec2; use crate::view::View; +use crate::Vec2; use crate::{Cursive, Printer, With}; use unicode_width::UnicodeWidthStr; diff --git a/src/views/canvas.rs b/src/views/canvas.rs index e0a8567..9729726 100644 --- a/src/views/canvas.rs +++ b/src/views/canvas.rs @@ -1,9 +1,9 @@ use crate::direction::Direction; use crate::event::{AnyCb, Event, EventResult}; use crate::rect::Rect; -use crate::vec::Vec2; use crate::view::{Selector, View}; use crate::Printer; +use crate::Vec2; use crate::With; // Define this type separately to appease the Clippy god diff --git a/src/views/checkbox.rs b/src/views/checkbox.rs index cc6eefd..81c7259 100644 --- a/src/views/checkbox.rs +++ b/src/views/checkbox.rs @@ -1,10 +1,10 @@ use crate::direction::Direction; use crate::event::{Event, EventResult, Key, MouseButton, MouseEvent}; use crate::theme::ColorStyle; -use crate::vec::Vec2; use crate::view::View; use crate::Cursive; use crate::Printer; +use crate::Vec2; use crate::With; use std::rc::Rc; diff --git a/src/views/debug_view.rs b/src/views/debug_view.rs index d41cfc5..902c7e9 100644 --- a/src/views/debug_view.rs +++ b/src/views/debug_view.rs @@ -1,8 +1,8 @@ use crate::logger; use crate::theme; -use crate::vec::Vec2; use crate::view::View; use crate::Printer; +use crate::Vec2; use unicode_width::UnicodeWidthStr; diff --git a/src/views/dialog.rs b/src/views/dialog.rs index e198035..a8ec988 100644 --- a/src/views/dialog.rs +++ b/src/views/dialog.rs @@ -3,11 +3,11 @@ use crate::direction::{Absolute, Direction, Relative}; use crate::event::{AnyCb, Event, EventResult, Key}; use crate::rect::Rect; use crate::theme::ColorStyle; -use crate::vec::Vec2; use crate::view::{Margins, Selector, View}; use crate::views::{BoxedView, Button, DummyView, LastSizeView, TextView}; use crate::Cursive; use crate::Printer; +use crate::Vec2; use crate::With; use std::cell::Cell; use std::cmp::max; diff --git a/src/views/edit_view.rs b/src/views/edit_view.rs index e2ff092..63f6daa 100644 --- a/src/views/edit_view.rs +++ b/src/views/edit_view.rs @@ -3,8 +3,8 @@ use crate::event::{Callback, Event, EventResult, Key, MouseEvent}; use crate::rect::Rect; use crate::theme::{ColorStyle, Effect}; use crate::utils::lines::simple::{simple_prefix, simple_suffix}; -use crate::vec::Vec2; use crate::view::View; +use crate::Vec2; use crate::{Cursive, Printer, With}; use std::cell::RefCell; use std::rc::Rc; diff --git a/src/views/hideable_view.rs b/src/views/hideable_view.rs index fa3c671..59907cb 100644 --- a/src/views/hideable_view.rs +++ b/src/views/hideable_view.rs @@ -1,6 +1,6 @@ use crate::event::AnyCb; -use crate::vec::Vec2; use crate::view::{Selector, View, ViewWrapper}; +use crate::Vec2; use crate::With; /// Wrapper around another view that can be hidden at will. diff --git a/src/views/last_size_view.rs b/src/views/last_size_view.rs index c295873..1694fc9 100644 --- a/src/views/last_size_view.rs +++ b/src/views/last_size_view.rs @@ -1,6 +1,6 @@ -use crate::vec::Vec2; use crate::view::View; use crate::view::ViewWrapper; +use crate::Vec2; /// Wrapper around a view that remembers its size. pub struct LastSizeView { diff --git a/src/views/linear_layout.rs b/src/views/linear_layout.rs index 5fe2fc4..a611010 100644 --- a/src/views/linear_layout.rs +++ b/src/views/linear_layout.rs @@ -1,9 +1,9 @@ use crate::direction; use crate::event::{AnyCb, Event, EventResult, Key}; use crate::rect::Rect; -use crate::vec::Vec2; use crate::view::{IntoBoxedView, Selector, SizeCache, View}; use crate::Printer; +use crate::Vec2; use crate::With; use crate::XY; use log::debug; diff --git a/src/views/list_view.rs b/src/views/list_view.rs index eb10ded..fb8df74 100644 --- a/src/views/list_view.rs +++ b/src/views/list_view.rs @@ -1,10 +1,10 @@ use crate::direction; use crate::event::{AnyCb, Callback, Event, EventResult, Key}; use crate::rect::Rect; -use crate::vec::Vec2; use crate::view::{IntoBoxedView, Selector, View}; use crate::Cursive; use crate::Printer; +use crate::Vec2; use crate::With; use log::debug; use std::rc::Rc; diff --git a/src/views/menu_popup.rs b/src/views/menu_popup.rs index 43b286a..14d6d17 100644 --- a/src/views/menu_popup.rs +++ b/src/views/menu_popup.rs @@ -4,12 +4,12 @@ use crate::event::{ }; use crate::menu::{MenuItem, MenuTree}; use crate::rect::Rect; -use crate::vec::Vec2; use crate::view::scroll; use crate::view::{Position, View}; use crate::views::OnEventView; use crate::Cursive; use crate::Printer; +use crate::Vec2; use crate::With; use std::cmp::min; use std::rc::Rc; diff --git a/src/views/menubar.rs b/src/views/menubar.rs index 7240b37..3410a63 100644 --- a/src/views/menubar.rs +++ b/src/views/menubar.rs @@ -3,11 +3,11 @@ use crate::event::*; use crate::menu::{MenuItem, MenuTree}; use crate::rect::Rect; use crate::theme::ColorStyle; -use crate::vec::Vec2; use crate::view::{Position, View}; use crate::views::{MenuPopup, OnEventView}; use crate::Cursive; use crate::Printer; +use crate::Vec2; use std::rc::Rc; use unicode_width::UnicodeWidthStr; diff --git a/src/views/padded_view.rs b/src/views/padded_view.rs index 7fb6821..0a3c9c6 100644 --- a/src/views/padded_view.rs +++ b/src/views/padded_view.rs @@ -1,7 +1,7 @@ use crate::event::{Event, EventResult}; -use crate::vec::Vec2; use crate::view::{Margins, View, ViewWrapper}; use crate::Printer; +use crate::Vec2; /// Adds padding to another view. /// diff --git a/src/views/panel.rs b/src/views/panel.rs index 4a58102..a381a98 100644 --- a/src/views/panel.rs +++ b/src/views/panel.rs @@ -2,9 +2,9 @@ use crate::align::*; use crate::event::{Event, EventResult}; use crate::rect::Rect; use crate::theme::ColorStyle; -use crate::vec::Vec2; use crate::view::{View, ViewWrapper}; use crate::Printer; +use crate::Vec2; use crate::With; use unicode_width::UnicodeWidthStr; diff --git a/src/views/radio.rs b/src/views/radio.rs index e7190a6..9dae412 100644 --- a/src/views/radio.rs +++ b/src/views/radio.rs @@ -1,9 +1,9 @@ use crate::direction::Direction; use crate::event::{Event, EventResult, Key, MouseButton, MouseEvent}; use crate::theme::ColorStyle; -use crate::vec::Vec2; use crate::view::View; use crate::Cursive; +use crate::Vec2; use crate::{Printer, With}; use std::cell::RefCell; use std::rc::Rc; diff --git a/src/views/resized_view.rs b/src/views/resized_view.rs index 276338a..77a6932 100644 --- a/src/views/resized_view.rs +++ b/src/views/resized_view.rs @@ -1,6 +1,6 @@ use crate::printer::Printer; -use crate::vec::Vec2; use crate::view::{SizeConstraint, View, ViewWrapper}; +use crate::Vec2; use crate::XY; /// Wrapper around another view, with a controlled size. @@ -230,9 +230,9 @@ impl ViewWrapper for ResizedView { #[cfg(test)] mod tests { - use crate::vec::Vec2; use crate::view::{Boxable, View}; use crate::views::DummyView; + use crate::Vec2; // No need to test `draw()` method as it's directly forwarded. diff --git a/src/views/select_view.rs b/src/views/select_view.rs index e7abbe8..36ca368 100644 --- a/src/views/select_view.rs +++ b/src/views/select_view.rs @@ -7,11 +7,11 @@ use crate::menu::MenuTree; use crate::rect::Rect; use crate::theme::ColorStyle; use crate::utils::markup::StyledString; -use crate::vec::Vec2; use crate::view::{Position, View}; use crate::views::MenuPopup; use crate::Cursive; use crate::Printer; +use crate::Vec2; use crate::With; use std::borrow::Borrow; use std::cell::Cell; diff --git a/src/views/shadow_view.rs b/src/views/shadow_view.rs index aa16e8e..950a31c 100644 --- a/src/views/shadow_view.rs +++ b/src/views/shadow_view.rs @@ -1,8 +1,8 @@ use crate::event::{Event, EventResult}; use crate::theme::ColorStyle; -use crate::vec::Vec2; use crate::view::{View, ViewWrapper}; use crate::Printer; +use crate::Vec2; /// Wrapper view that adds a shadow. /// diff --git a/src/views/slider_view.rs b/src/views/slider_view.rs index 6441cc3..731b199 100644 --- a/src/views/slider_view.rs +++ b/src/views/slider_view.rs @@ -3,8 +3,8 @@ use crate::event::{ Callback, Event, EventResult, Key, MouseButton, MouseEvent, }; use crate::theme::ColorStyle; -use crate::vec::Vec2; use crate::view::View; +use crate::Vec2; use crate::With; use crate::{Cursive, Printer}; use std::rc::Rc; diff --git a/src/views/stack_view.rs b/src/views/stack_view.rs index 18ac286..23db237 100644 --- a/src/views/stack_view.rs +++ b/src/views/stack_view.rs @@ -1,12 +1,12 @@ use crate::direction::Direction; use crate::event::{AnyCb, Event, EventResult}; use crate::theme::ColorStyle; -use crate::vec::Vec2; use crate::view::{ IntoBoxedView, Offset, Position, Selector, View, ViewWrapper, }; use crate::views::{BoxedView, CircularFocus, Layer, ShadowView}; use crate::Printer; +use crate::Vec2; use crate::With; use std::cell; use std::ops::Deref; diff --git a/src/views/text_area.rs b/src/views/text_area.rs index 69fe64a..f076218 100644 --- a/src/views/text_area.rs +++ b/src/views/text_area.rs @@ -3,8 +3,8 @@ use crate::event::{Event, EventResult, Key, MouseButton, MouseEvent}; use crate::rect::Rect; use crate::theme::{ColorStyle, Effect}; use crate::utils::lines::simple::{prefix, simple_prefix, LinesIterator, Row}; -use crate::vec::Vec2; use crate::view::{ScrollBase, SizeCache, View}; +use crate::Vec2; use crate::{Printer, With, XY}; use log::debug; use std::cmp::min; diff --git a/src/views/tracked_view.rs b/src/views/tracked_view.rs index 9f6fc2f..bbc0394 100644 --- a/src/views/tracked_view.rs +++ b/src/views/tracked_view.rs @@ -1,7 +1,7 @@ -use crate::vec::Vec2; use crate::view::{View, ViewWrapper}; use crate::views::NamedView; use crate::Printer; +use crate::Vec2; use std::cell::Cell; /// Wrapper around a view that remembers its position.