From 4039f7200091a0a2d78fa7463a40a5ccd20b5d7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Tue, 18 Jun 2019 23:23:03 +0200 Subject: [PATCH] Fix redundant static lifetime clippy lint --- alacritty_terminal/src/ansi.rs | 10 +++++----- alacritty_terminal/src/config/bindings.rs | 2 +- alacritty_terminal/src/config/mod.rs | 2 +- alacritty_terminal/src/renderer/mod.rs | 20 ++++++++------------ alacritty_terminal/src/window.rs | 2 +- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 27c07a5..07fc18e 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -1420,7 +1420,7 @@ mod tests { #[test] fn parse_control_attribute() { - static BYTES: &'static [u8] = &[0x1b, 0x5b, 0x31, 0x6d]; + static BYTES: &[u8] = &[0x1b, 0x5b, 0x31, 0x6d]; let mut parser = Processor::new(); let mut handler = AttrHandler::default(); @@ -1434,7 +1434,7 @@ mod tests { #[test] fn parse_truecolor_attr() { - static BYTES: &'static [u8] = &[ + static BYTES: &[u8] = &[ 0x1b, 0x5b, 0x33, 0x38, 0x3b, 0x32, 0x3b, 0x31, 0x32, 0x38, 0x3b, 0x36, 0x36, 0x3b, 0x32, 0x35, 0x35, 0x6d, ]; @@ -1454,7 +1454,7 @@ mod tests { /// No exactly a test; useful for debugging #[test] fn parse_zsh_startup() { - static BYTES: &'static [u8] = &[ + static BYTES: &[u8] = &[ 0x1b, 0x5b, 0x31, 0x6d, 0x1b, 0x5b, 0x37, 0x6d, 0x25, 0x1b, 0x5b, 0x32, 0x37, 0x6d, 0x1b, 0x5b, 0x31, 0x6d, 0x1b, 0x5b, 0x30, 0x6d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, @@ -1512,7 +1512,7 @@ mod tests { #[test] fn parse_designate_g0_as_line_drawing() { - static BYTES: &'static [u8] = &[0x1b, b'(', b'0']; + static BYTES: &[u8] = &[0x1b, b'(', b'0']; let mut parser = Processor::new(); let mut handler = CharsetHandler::default(); @@ -1526,7 +1526,7 @@ mod tests { #[test] fn parse_designate_g1_as_line_drawing_and_invoke() { - static BYTES: &'static [u8] = &[0x1b, 0x29, 0x30, 0x0e]; + static BYTES: &[u8] = &[0x1b, 0x29, 0x30, 0x0e]; let mut parser = Processor::new(); let mut handler = CharsetHandler::default(); diff --git a/alacritty_terminal/src/config/bindings.rs b/alacritty_terminal/src/config/bindings.rs index 010c0ea..df68a39 100644 --- a/alacritty_terminal/src/config/bindings.rs +++ b/alacritty_terminal/src/config/bindings.rs @@ -727,7 +727,7 @@ impl<'a> Deserialize<'a> for RawBinding { { struct FieldVisitor; - static FIELDS: &'static [&'static str] = + static FIELDS: &[&str] = &["key", "mods", "mode", "action", "chars", "mouse", "command"]; impl<'a> Visitor<'a> for FieldVisitor { diff --git a/alacritty_terminal/src/config/mod.rs b/alacritty_terminal/src/config/mod.rs index 0af7e81..54af0fd 100644 --- a/alacritty_terminal/src/config/mod.rs +++ b/alacritty_terminal/src/config/mod.rs @@ -43,7 +43,7 @@ pub use crate::config::scrolling::Scrolling; pub use crate::config::visual_bell::{VisualBellAnimation, VisualBellConfig}; pub use crate::config::window::{Decorations, Dimensions, StartupMode, WindowConfig}; -pub static DEFAULT_ALACRITTY_CONFIG: &'static str = +pub static DEFAULT_ALACRITTY_CONFIG: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../alacritty.yml")); const MAX_SCROLLBACK_LINES: u32 = 100_000; diff --git a/alacritty_terminal/src/renderer/mod.rs b/alacritty_terminal/src/renderer/mod.rs index dfaa797..1e75065 100644 --- a/alacritty_terminal/src/renderer/mod.rs +++ b/alacritty_terminal/src/renderer/mod.rs @@ -38,23 +38,19 @@ use crate::term::{self, cell, RenderableCell, RenderableCellContent}; pub mod rects; // Shader paths for live reload -static TEXT_SHADER_F_PATH: &'static str = - concat!(env!("CARGO_MANIFEST_DIR"), "/../res/text.f.glsl"); -static TEXT_SHADER_V_PATH: &'static str = - concat!(env!("CARGO_MANIFEST_DIR"), "/../res/text.v.glsl"); -static RECT_SHADER_F_PATH: &'static str = - concat!(env!("CARGO_MANIFEST_DIR"), "/../res/rect.f.glsl"); -static RECT_SHADER_V_PATH: &'static str = - concat!(env!("CARGO_MANIFEST_DIR"), "/../res/rect.v.glsl"); +static TEXT_SHADER_F_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../res/text.f.glsl"); +static TEXT_SHADER_V_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../res/text.v.glsl"); +static RECT_SHADER_F_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../res/rect.f.glsl"); +static RECT_SHADER_V_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../res/rect.v.glsl"); // Shader source which is used when live-shader-reload feature is disable -static TEXT_SHADER_F: &'static str = +static TEXT_SHADER_F: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../res/text.f.glsl")); -static TEXT_SHADER_V: &'static str = +static TEXT_SHADER_V: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../res/text.v.glsl")); -static RECT_SHADER_F: &'static str = +static RECT_SHADER_F: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../res/rect.f.glsl")); -static RECT_SHADER_V: &'static str = +static RECT_SHADER_V: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/../res/rect.v.glsl")); /// `LoadGlyph` allows for copying a rasterized glyph into graphics memory diff --git a/alacritty_terminal/src/window.rs b/alacritty_terminal/src/window.rs index 97f29c5..186d3c1 100644 --- a/alacritty_terminal/src/window.rs +++ b/alacritty_terminal/src/window.rs @@ -35,7 +35,7 @@ use crate::config::{Config, Decorations, StartupMode, WindowConfig}; // It's required to be in this directory due to the `windows.rc` file #[cfg(not(target_os = "macos"))] -static WINDOW_ICON: &'static [u8] = include_bytes!("../../extra/windows/alacritty.ico"); +static WINDOW_ICON: &[u8] = include_bytes!("../../extra/windows/alacritty.ico"); /// Default Alacritty name, used for window title and class. pub const DEFAULT_NAME: &str = "Alacritty";