diff --git a/src/backend/rustbox.rs b/src/backend/rustbox.rs index e4b36448..921724c5 100644 --- a/src/backend/rustbox.rs +++ b/src/backend/rustbox.rs @@ -71,7 +71,7 @@ impl Backend for RustboxBackend { } fn rgb_to_byte(r: u8, g: u8, b: u8) -> u16 { - (((r & 255 & 0xC0) + ((g & 255 & 0xE0) >> 2) + ((b & 0xE0) >> 5)) & 0xFF) as u16 + u16::from((r & 0xC0) + ((g & 0xE0) >> 2) + ((b & 0xE0) >> 5)) } impl Into for Color { diff --git a/src/symbols.rs b/src/symbols.rs index efaac87a..d9b2bf5c 100644 --- a/src/symbols.rs +++ b/src/symbols.rs @@ -1,36 +1,36 @@ pub mod block { - pub const FULL: &'static str = "█"; - pub const SEVEN_EIGHTHS: &'static str = "▉"; - pub const THREE_QUATERS: &'static str = "▊"; - pub const FIVE_EIGHTHS: &'static str = "▋"; - pub const HALF: &'static str = "▌"; - pub const THREE_EIGHTHS: &'static str = "▍"; - pub const ONE_QUATER: &'static str = "▎"; - pub const ONE_EIGHTH: &'static str = "▏"; + pub const FULL: &str = "█"; + pub const SEVEN_EIGHTHS: &str = "▉"; + pub const THREE_QUATERS: &str = "▊"; + pub const FIVE_EIGHTHS: &str = "▋"; + pub const HALF: &str = "▌"; + pub const THREE_EIGHTHS: &str = "▍"; + pub const ONE_QUATER: &str = "▎"; + pub const ONE_EIGHTH: &str = "▏"; } pub mod bar { - pub const FULL: &'static str = "█"; - pub const SEVEN_EIGHTHS: &'static str = "▇"; - pub const THREE_QUATERS: &'static str = "▆"; - pub const FIVE_EIGHTHS: &'static str = "▅"; - pub const HALF: &'static str = "▄"; - pub const THREE_EIGHTHS: &'static str = "▃"; - pub const ONE_QUATER: &'static str = "▂"; - pub const ONE_EIGHTH: &'static str = "▁"; + pub const FULL: &str = "█"; + pub const SEVEN_EIGHTHS: &str = "▇"; + pub const THREE_QUATERS: &str = "▆"; + pub const FIVE_EIGHTHS: &str = "▅"; + pub const HALF: &str = "▄"; + pub const THREE_EIGHTHS: &str = "▃"; + pub const ONE_QUATER: &str = "▂"; + pub const ONE_EIGHTH: &str = "▁"; } pub mod line { - pub const TOP_RIGHT: &'static str = "┐"; - pub const VERTICAL: &'static str = "│"; - pub const HORIZONTAL: &'static str = "─"; - pub const TOP_LEFT: &'static str = "┌"; - pub const BOTTOM_RIGHT: &'static str = "┘"; - pub const BOTTOM_LEFT: &'static str = "└"; - pub const VERTICAL_LEFT: &'static str = "┤"; - pub const VERTICAL_RIGHT: &'static str = "├"; - pub const HORIZONTAL_DOWN: &'static str = "┬"; - pub const HORIZONTAL_UP: &'static str = "┴"; + pub const TOP_RIGHT: &str = "┐"; + pub const VERTICAL: &str = "│"; + pub const HORIZONTAL: &str = "─"; + pub const TOP_LEFT: &str = "┌"; + pub const BOTTOM_RIGHT: &str = "┘"; + pub const BOTTOM_LEFT: &str = "└"; + pub const VERTICAL_LEFT: &str = "┤"; + pub const VERTICAL_RIGHT: &str = "├"; + pub const HORIZONTAL_DOWN: &str = "┬"; + pub const HORIZONTAL_UP: &str = "┴"; } -pub const DOT: &'static str = "•"; +pub const DOT: &str = "•"; diff --git a/src/widgets/canvas/world.rs b/src/widgets/canvas/world.rs index e382eea9..775486aa 100644 --- a/src/widgets/canvas/world.rs +++ b/src/widgets/canvas/world.rs @@ -1,4 +1,5 @@ -/// Source: http://www.gnuplotting.org/plotting-the-world-revisited/ +/// [Source data](http://www.gnuplotting.org/plotting-the-world-revisited) + pub static WORLD_HIGH_RESOLUTION: [(f64, f64); 5125] = [ (-163.71289567772871, -78.595667413241543), (-163.105800951163786, -78.223338718578589), diff --git a/src/widgets/list.rs b/src/widgets/list.rs index 463de425..42b9ebb1 100644 --- a/src/widgets/list.rs +++ b/src/widgets/list.rs @@ -102,7 +102,7 @@ where &Style::default(), ); } - Item::StyledData(ref v, ref s) => { + Item::StyledData(ref v, s) => { buf.set_stringn( list_area.left(), list_area.top() + i as u16,