[clippy] Fix warnings

This commit is contained in:
Florian Dehau 2017-10-30 22:58:34 +01:00
parent f24517bc5a
commit ba80889333
4 changed files with 31 additions and 30 deletions

View file

@ -71,7 +71,7 @@ impl Backend for RustboxBackend {
} }
fn rgb_to_byte(r: u8, g: u8, b: u8) -> u16 { 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<rustbox::Color> for Color { impl Into<rustbox::Color> for Color {

View file

@ -1,36 +1,36 @@
pub mod block { pub mod block {
pub const FULL: &'static str = ""; pub const FULL: &str = "";
pub const SEVEN_EIGHTHS: &'static str = ""; pub const SEVEN_EIGHTHS: &str = "";
pub const THREE_QUATERS: &'static str = ""; pub const THREE_QUATERS: &str = "";
pub const FIVE_EIGHTHS: &'static str = ""; pub const FIVE_EIGHTHS: &str = "";
pub const HALF: &'static str = ""; pub const HALF: &str = "";
pub const THREE_EIGHTHS: &'static str = ""; pub const THREE_EIGHTHS: &str = "";
pub const ONE_QUATER: &'static str = ""; pub const ONE_QUATER: &str = "";
pub const ONE_EIGHTH: &'static str = ""; pub const ONE_EIGHTH: &str = "";
} }
pub mod bar { pub mod bar {
pub const FULL: &'static str = ""; pub const FULL: &str = "";
pub const SEVEN_EIGHTHS: &'static str = ""; pub const SEVEN_EIGHTHS: &str = "";
pub const THREE_QUATERS: &'static str = ""; pub const THREE_QUATERS: &str = "";
pub const FIVE_EIGHTHS: &'static str = ""; pub const FIVE_EIGHTHS: &str = "";
pub const HALF: &'static str = ""; pub const HALF: &str = "";
pub const THREE_EIGHTHS: &'static str = ""; pub const THREE_EIGHTHS: &str = "";
pub const ONE_QUATER: &'static str = ""; pub const ONE_QUATER: &str = "";
pub const ONE_EIGHTH: &'static str = ""; pub const ONE_EIGHTH: &str = "";
} }
pub mod line { pub mod line {
pub const TOP_RIGHT: &'static str = ""; pub const TOP_RIGHT: &str = "";
pub const VERTICAL: &'static str = ""; pub const VERTICAL: &str = "";
pub const HORIZONTAL: &'static str = ""; pub const HORIZONTAL: &str = "";
pub const TOP_LEFT: &'static str = ""; pub const TOP_LEFT: &str = "";
pub const BOTTOM_RIGHT: &'static str = ""; pub const BOTTOM_RIGHT: &str = "";
pub const BOTTOM_LEFT: &'static str = ""; pub const BOTTOM_LEFT: &str = "";
pub const VERTICAL_LEFT: &'static str = ""; pub const VERTICAL_LEFT: &str = "";
pub const VERTICAL_RIGHT: &'static str = ""; pub const VERTICAL_RIGHT: &str = "";
pub const HORIZONTAL_DOWN: &'static str = ""; pub const HORIZONTAL_DOWN: &str = "";
pub const HORIZONTAL_UP: &'static str = ""; pub const HORIZONTAL_UP: &str = "";
} }
pub const DOT: &'static str = ""; pub const DOT: &str = "";

View file

@ -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] = [ pub static WORLD_HIGH_RESOLUTION: [(f64, f64); 5125] = [
(-163.71289567772871, -78.595667413241543), (-163.71289567772871, -78.595667413241543),
(-163.105800951163786, -78.223338718578589), (-163.105800951163786, -78.223338718578589),

View file

@ -102,7 +102,7 @@ where
&Style::default(), &Style::default(),
); );
} }
Item::StyledData(ref v, ref s) => { Item::StyledData(ref v, s) => {
buf.set_stringn( buf.set_stringn(
list_area.left(), list_area.left(),
list_area.top() + i as u16, list_area.top() + i as u16,