diff --git a/examples/menubar.rs b/examples/menubar.rs index 0b448c3..ac6786c 100644 --- a/examples/menubar.rs +++ b/examples/menubar.rs @@ -68,6 +68,7 @@ fn main() { // When `autohide` is on (default), the menu only appears when active. // Turning it off will leave the menu always visible. + // Try uncommenting this line! // siv.set_autohide_menu(false); diff --git a/src/backend/blt.rs b/src/backend/blt.rs index 4af99ad..f3a47cc 100644 --- a/src/backend/blt.rs +++ b/src/backend/blt.rs @@ -178,10 +178,10 @@ impl backend::Backend for Concrete { fn with_effect(&self, effect: Effect, f: F) { match effect { // TODO: does BLT support bold/italic/underline? - Effect::Bold | - Effect::Italic | - Effect::Underline | - Effect::Simple => f(), + Effect::Bold + | Effect::Italic + | Effect::Underline + | Effect::Simple => f(), // TODO: how to do this correctly?` // BLT itself doesn't do this kind of thing, // we'd need the colours in our position, diff --git a/src/theme/border_style.rs b/src/theme/border_style.rs index 9a3ef3d..903f93f 100644 --- a/src/theme/border_style.rs +++ b/src/theme/border_style.rs @@ -24,4 +24,3 @@ impl> From for BorderStyle { } } } - diff --git a/src/theme/mod.rs b/src/theme/mod.rs index 7ee7690..e9f3d73 100644 --- a/src/theme/mod.rs +++ b/src/theme/mod.rs @@ -121,14 +121,13 @@ mod color_style; mod border_style; mod palette; -pub use self::color::{Color, BaseColor}; pub use self::border_style::BorderStyle; +pub use self::color::{BaseColor, Color}; pub use self::color_pair::ColorPair; pub use self::color_style::ColorStyle; pub use self::effect::Effect; pub use self::palette::Palette; pub use self::style::Style; - use std::fs::File; use std::io; use std::io::Read; @@ -183,8 +182,6 @@ impl Theme { } } - - /// Possible error returned when loading a theme. #[derive(Debug)] pub enum Error { @@ -206,7 +203,6 @@ impl From for Error { } } - /// Loads a theme from file and sets it as active. pub fn load_theme_file>(filename: P) -> Result { let content = { @@ -233,4 +229,3 @@ pub fn load_theme(content: &str) -> Result { pub fn load_default() -> Theme { Theme::default() } - diff --git a/src/utils/lines/simple/lines_iterator.rs b/src/utils/lines/simple/lines_iterator.rs index 4fe1eb3..dfc7c2a 100644 --- a/src/utils/lines/simple/lines_iterator.rs +++ b/src/utils/lines/simple/lines_iterator.rs @@ -1,6 +1,6 @@ +use super::{prefix, Row}; use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; -use super::{prefix, Row}; /// Generates rows of text in constrained width. /// diff --git a/src/utils/lines/simple/mod.rs b/src/utils/lines/simple/mod.rs index 7ad085f..f8abf4e 100644 --- a/src/utils/lines/simple/mod.rs +++ b/src/utils/lines/simple/mod.rs @@ -9,7 +9,6 @@ mod row; pub use self::lines_iterator::LinesIterator; pub use self::row::Row; - use unicode_segmentation::UnicodeSegmentation; use unicode_width::UnicodeWidthStr; diff --git a/src/utils/lines/simple/row.rs b/src/utils/lines/simple/row.rs index 4ccf512..25e75a1 100644 --- a/src/utils/lines/simple/row.rs +++ b/src/utils/lines/simple/row.rs @@ -34,4 +34,3 @@ impl Row { self.end -= offset; } } - diff --git a/src/utils/lines/spans/mod.rs b/src/utils/lines/spans/mod.rs index d6fc88c..e2b0a91 100644 --- a/src/utils/lines/spans/mod.rs +++ b/src/utils/lines/spans/mod.rs @@ -15,12 +15,11 @@ mod segment; #[cfg(test)] mod tests; -use std::borrow::Cow; -use theme::Style; - pub use self::lines_iterator::SpanLinesIterator; pub use self::row::Row; pub use self::segment::Segment; +use std::borrow::Cow; +use theme::Style; /// Input to the algorithm #[derive(Debug, Clone, PartialEq, Eq)] @@ -37,4 +36,3 @@ pub struct Span<'a> { /// Style to apply to this span of text. pub style: Style, } - diff --git a/src/utils/lines/spans/prefix.rs b/src/utils/lines/spans/prefix.rs index 43c7337..f713dc2 100644 --- a/src/utils/lines/spans/prefix.rs +++ b/src/utils/lines/spans/prefix.rs @@ -109,4 +109,3 @@ fn consider_chunk(available: usize, chunk: &Chunk) -> ChunkFitResult { ChunkFitResult::DoesNotFit } } - diff --git a/src/utils/lines/spans/row.rs b/src/utils/lines/spans/row.rs index f75fb4f..ea31b10 100644 --- a/src/utils/lines/spans/row.rs +++ b/src/utils/lines/spans/row.rs @@ -1,7 +1,6 @@ +use super::{Segment, Span}; use std::borrow::Cow; -use super::{Span, Segment}; - /// A list of segments representing a row of text #[derive(Debug, Clone, PartialEq, Eq)] pub struct Row { @@ -29,5 +28,3 @@ impl Row { .collect() } } - - diff --git a/src/utils/lines/spans/segment.rs b/src/utils/lines/spans/segment.rs index 62d4513..2e19bec 100644 --- a/src/utils/lines/spans/segment.rs +++ b/src/utils/lines/spans/segment.rs @@ -1,4 +1,3 @@ - /// Refers to a part of a span #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Segment { diff --git a/src/utils/lines/spans/segment_merge_iterator.rs b/src/utils/lines/spans/segment_merge_iterator.rs index 66e2b53..9d3e202 100644 --- a/src/utils/lines/spans/segment_merge_iterator.rs +++ b/src/utils/lines/spans/segment_merge_iterator.rs @@ -46,5 +46,3 @@ where } } } - - diff --git a/src/views/text_view.rs b/src/views/text_view.rs index f301272..424644f 100644 --- a/src/views/text_view.rs +++ b/src/views/text_view.rs @@ -540,7 +540,8 @@ impl View for TextView { self.rows.len() }; - self.scrollbase.set_heights(available_height, self.rows.len()); + self.scrollbase + .set_heights(available_height, self.rows.len()); self.adjust_scroll(); } }