diff --git a/src/lib.rs b/src/lib.rs index b30d6a6..2fb29be 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -229,7 +229,8 @@ impl Cursive { /// Loads a theme from the given file. /// /// `filename` must point to a valid toml file. - pub fn load_theme_file>(&mut self, filename: P) -> Result<(), theme::Error> { + pub fn load_theme_file>(&mut self, filename: P) + -> Result<(), theme::Error> { self.theme = try!(theme::load_theme_file(filename)); Ok(()) } diff --git a/src/theme.rs b/src/theme.rs index c67af60..f241788 100644 --- a/src/theme.rs +++ b/src/theme.rs @@ -36,7 +36,7 @@ //! Color styles are defined to easily refer to a pair of colors from the //! palette. //! -//! * **`Background`**: style used to print the application background. +//! * **`Background`**: style used to print the application background. //! * Its *background* color is `background`. //! * Its *foreground* color is unimportant as no characters are ever //! printed in the background. diff --git a/src/view/id_view.rs b/src/view/id_view.rs index 8b9f3c6..8e64740 100644 --- a/src/view/id_view.rs +++ b/src/view/id_view.rs @@ -31,11 +31,10 @@ impl ViewWrapper for IdView { /// Makes a view wrappable in an `IdView`. pub trait Identifiable: View + Sized { - /// Wraps this view into an IdView with the given id. fn with_id(self, id: &str) -> IdView { IdView::new(id, self) } } -impl Identifiable for T {} +impl Identifiable for T {} diff --git a/src/view/panel.rs b/src/view/panel.rs index c0d1845..0da7054 100644 --- a/src/view/panel.rs +++ b/src/view/panel.rs @@ -10,9 +10,7 @@ pub struct Panel { impl Panel { /// Creates a new panel around the given view. pub fn new(view: V) -> Self { - Panel { - view: view, - } + Panel { view: view } } } diff --git a/src/view/progress_bar.rs b/src/view/progress_bar.rs index 060ecc7..48dbba7 100644 --- a/src/view/progress_bar.rs +++ b/src/view/progress_bar.rs @@ -46,9 +46,7 @@ impl ProgressBar { /// Sets the callback to follow. /// /// Whenever `callback` is set, it will be called on the next event loop. - pub fn with_callback(mut self, - callback: Arc>) - -> Self { + pub fn with_callback(mut self, callback: Arc>) -> Self { self.callback = Some(callback); self } @@ -88,7 +86,8 @@ impl View for ProgressBar { let available = printer.size.x; let value = self.value.load(Ordering::Relaxed); - let length = ((1 + available) * (value - self.min)) / (1 + self.max - self.min); + let length = ((1 + available) * (value - self.min)) / + (1 + self.max - self.min); printer.with_color(ColorStyle::Highlight, |printer| { printer.print_hline((0, 0), length, " "); });