From 93780ef0929e08f3c5212e5451152ecaf1a28813 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 7 Jun 2018 15:52:06 +0000 Subject: [PATCH 01/32] Allow disabling DPI scaling This makes it possible to disable DPI scaling completely, instead the the display pixel ration will always be fixed to 1.0. By default nothing has changed and DPI is still enabled, this just seems like a better way than running `WINIT_HIDPI_FACTOR=1.0 alacritty` every time the user wants to start alacritty. It would be possible to allow specifying any DPR, however I've decided against this since I'd assume it's a very rare usecase. It's also still possible to make use of `WINIT_HIDPI_FACTOR` to do this on X11. Currently this is not updated at runtime using the live config update, there is not really much of a technical limitation why this woudn't be possible, however a solution for that issue should be first added in jwilm/alacritty#1346, once a system is established for changing DPI at runtime, porting that functionality to this PR should be simple. --- alacritty.yml | 6 ++++++ alacritty_macos.yml | 4 ++++ src/config.rs | 16 +++++++++++++--- src/display.rs | 11 +++++++---- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/alacritty.yml b/alacritty.yml index 38c57b3e..6290edfa 100644 --- a/alacritty.yml +++ b/alacritty.yml @@ -93,6 +93,12 @@ font: x: 0 y: 0 + # Scale the font size based on the monitor's DPI. This will lead to bigger text on HiDPI + # screens and make reading text a little easier. + # On X11 it is possible to change the DPI for each instance of alacritty by using + # `WINIT_HIDPI_FACTOR=1.0 alacritty` to scale the font. + scale_with_dpi: true + # OS X only: use thin stroke font rendering. Thin strokes are suitable # for retina displays, but for non-retina you probably want this set to # false. diff --git a/alacritty_macos.yml b/alacritty_macos.yml index be87a36a..eff28e3e 100644 --- a/alacritty_macos.yml +++ b/alacritty_macos.yml @@ -73,6 +73,10 @@ font: x: 0 y: 0 + # Scale the font size based on the monitor's DPI. This will lead to bigger text on HiDPI + # screens and make reading text a little easier. + scale_with_dpi: true + # OS X only: use thin stroke font rendering. Thin strokes are suitable # for retina displays, but for non-retina you probably want this set to # false. diff --git a/src/config.rs b/src/config.rs index 40c550b0..a8034139 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1541,7 +1541,10 @@ pub struct Font { glyph_offset: Delta, #[serde(default="true_bool", deserialize_with = "default_true_bool")] - use_thin_strokes: bool + use_thin_strokes: bool, + + #[serde(default="true_bool", deserialize_with = "default_true_bool")] + scale_with_dpi: bool, } fn default_bold_desc() -> FontDescription { @@ -1594,6 +1597,11 @@ impl Font { .. self } } + + /// Check whether dpi should be applied + pub fn scale_with_dpi(&self) -> bool { + self.scale_with_dpi + } } #[cfg(target_os = "macos")] @@ -1605,8 +1613,9 @@ impl Default for Font { italic: FontDescription::new_with_family("Menlo"), size: Size::new(11.0), use_thin_strokes: true, + scale_with_dpi: true, + glyph_offset: Default::default(), offset: Default::default(), - glyph_offset: Default::default() } } } @@ -1620,8 +1629,9 @@ impl Default for Font { italic: FontDescription::new_with_family("monospace"), size: Size::new(11.0), use_thin_strokes: false, + scale_with_dpi: true, + glyph_offset: Default::default(), offset: Default::default(), - glyph_offset: Default::default() } } } diff --git a/src/display.rs b/src/display.rs index 733c66e8..2b87bf50 100644 --- a/src/display.rs +++ b/src/display.rs @@ -142,7 +142,11 @@ impl Display { // get window properties for initializing the other subsystems let mut viewport_size = window.inner_size_pixels() .expect("glutin returns window size"); - let dpr = window.hidpi_factor(); + let dpr = if config.font().scale_with_dpi() { + window.hidpi_factor() + } else { + 1.0 + }; info!("device_pixel_ratio: {}", dpr); @@ -150,7 +154,7 @@ impl Display { let mut renderer = QuadRenderer::new(config, viewport_size)?; let (glyph_cache, cell_width, cell_height) = - Self::new_glyph_cache(&window, &mut renderer, config)?; + Self::new_glyph_cache(dpr, &mut renderer, config)?; let dimensions = options.dimensions() @@ -211,11 +215,10 @@ impl Display { }) } - fn new_glyph_cache(window : &Window, renderer : &mut QuadRenderer, config: &Config) + fn new_glyph_cache(dpr: f32, renderer: &mut QuadRenderer, config: &Config) -> Result<(GlyphCache, f32, f32), Error> { let font = config.font().clone(); - let dpr = window.hidpi_factor(); let rasterizer = font::Rasterizer::new(dpr, config.use_thin_strokes())?; // Initialize glyph cache From 66acf1e03da4d0206e3368bf58953b071887ccb2 Mon Sep 17 00:00:00 2001 From: Tezkerek Date: Thu, 7 Jun 2018 19:53:16 +0300 Subject: [PATCH 02/32] Add working --class and --title CLI parameters --- src/cli.rs | 11 +++++++++++ src/display.rs | 2 +- src/window.rs | 13 +++++++------ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 532c46cd..e57caf0d 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -19,6 +19,7 @@ use std::path::{Path, PathBuf}; use std::borrow::Cow; const DEFAULT_TITLE: &str = "Alacritty"; +const DEFAULT_CLASS: &str = "Alacritty"; /// Options specified on the command line pub struct Options { @@ -27,6 +28,7 @@ pub struct Options { pub ref_test: bool, pub dimensions: Option, pub title: String, + pub class: String, pub log_level: log::LevelFilter, pub command: Option>, pub working_dir: Option, @@ -41,6 +43,7 @@ impl Default for Options { ref_test: false, dimensions: None, title: DEFAULT_TITLE.to_owned(), + class: DEFAULT_CLASS.to_owned(), log_level: log::LevelFilter::Warn, command: None, working_dir: None, @@ -81,6 +84,10 @@ impl Options { .short("t") .default_value(DEFAULT_TITLE) .help("Defines the window title")) + .arg(Arg::with_name("class") + .long("class") + .default_value(DEFAULT_CLASS) + .help("Defines window class on X11")) .arg(Arg::with_name("q") .short("q") .multiple(true) @@ -136,6 +143,10 @@ impl Options { options.title = title.to_owned(); } + if let Some(class) = matches.value_of("class") { + options.class = class.to_owned(); + } + match matches.occurrences_of("q") { 0 => {}, 1 => options.log_level = log::LevelFilter::Error, diff --git a/src/display.rs b/src/display.rs index 2b87bf50..e0453f72 100644 --- a/src/display.rs +++ b/src/display.rs @@ -137,7 +137,7 @@ impl Display { let render_timer = config.render_timer(); // Create the window where Alacritty will be displayed - let mut window = Window::new(&options.title, config.window())?; + let mut window = Window::new(&options, config.window())?; // get window properties for initializing the other subsystems let mut viewport_size = window.inner_size_pixels() diff --git a/src/window.rs b/src/window.rs index 987332e0..ef0d9269 100644 --- a/src/window.rs +++ b/src/window.rs @@ -22,6 +22,7 @@ use glutin::GlContext; use MouseCursor; +use cli::Options; use config::WindowConfig; /// Window errors @@ -199,17 +200,17 @@ impl Window { /// /// This creates a window and fully initializes a window. pub fn new( - title: &str, + options: &Options, window_config: &WindowConfig, ) -> Result { let event_loop = EventsLoop::new(); let window_builder = WindowBuilder::new() - .with_title(title) + .with_title(&*options.title) .with_visibility(false) .with_transparency(true) .with_decorations(window_config.decorations()); - let window_builder = Window::platform_builder_ext(window_builder); + let window_builder = Window::platform_builder_ext(window_builder, &options.class); let window = create_gl_window(window_builder.clone(), &event_loop, false) .or_else(|_| create_gl_window(window_builder, &event_loop, true))?; window.show(); @@ -322,13 +323,13 @@ impl Window { } #[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd"))] - fn platform_builder_ext(window_builder: WindowBuilder) -> WindowBuilder { + fn platform_builder_ext(window_builder: WindowBuilder, wm_class: &str) -> WindowBuilder { use glutin::os::unix::WindowBuilderExt; - window_builder.with_class("alacritty".to_owned(), "Alacritty".to_owned()) + window_builder.with_class(wm_class.to_owned(), "Alacritty".to_owned()) } #[cfg(not(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "openbsd")))] - fn platform_builder_ext(window_builder: WindowBuilder) -> WindowBuilder { + fn platform_builder_ext(window_builder: WindowBuilder, _: &str) -> WindowBuilder { window_builder } From 6cbae83f174fa6d114ea66b1f8dd6185950ca835 Mon Sep 17 00:00:00 2001 From: Felippe da Motta Raposo Date: Fri, 8 Jun 2018 16:32:21 -0700 Subject: [PATCH 03/32] Reduce Increase-/DecreaseFontSize step to 0.5 Until now the Increase-/DecreaseFontSize keybinds hand a step size of 1.0. Since the font size however is multiplied by two to allow more granular font size control, this lead to the bindings skipping one font size (incrementing/decrementing by +-2). To fix this the step size of the Increase-/DecreaseFontSize bindings has been reduced to the minimum step size that exists with the current font configuration (0.5). This should allow users to increment and decrement the font size by a single point instead of two. This also adds a few tests to make sure the methods for increasing/decreasing/resetting font size work properly. --- src/event.rs | 2 +- src/input.rs | 10 ++++--- src/term/mod.rs | 78 ++++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 81 insertions(+), 9 deletions(-) diff --git a/src/event.rs b/src/event.rs index 4ae25860..f592da5c 100644 --- a/src/event.rs +++ b/src/event.rs @@ -106,7 +106,7 @@ impl<'a, N: Notify + 'a> input::ActionContext for ActionContext<'a, N> { self.terminal.pixels_to_coords(self.mouse.x as usize, self.mouse.y as usize) } - fn change_font_size(&mut self, delta: i8) { + fn change_font_size(&mut self, delta: f32) { self.terminal.change_font_size(delta); } diff --git a/src/input.rs b/src/input.rs index 2d603783..7afd359d 100644 --- a/src/input.rs +++ b/src/input.rs @@ -34,6 +34,8 @@ use term::SizeInfo; use term::mode::TermMode; use util::fmt::Red; +pub const FONT_SIZE_STEP: f32 = 0.5; + /// Processes input from glutin. /// /// An escape sequence may be emitted in case specific keys or key combinations @@ -62,7 +64,7 @@ pub trait ActionContext { fn received_count(&mut self) -> &mut usize; fn suppress_chars(&mut self) -> &mut bool; fn last_modifiers(&mut self) -> &mut ModifiersState; - fn change_font_size(&mut self, delta: i8); + fn change_font_size(&mut self, delta: f32); fn reset_font_size(&mut self); } @@ -227,10 +229,10 @@ impl Action { ::std::process::exit(0); }, Action::IncreaseFontSize => { - ctx.change_font_size(1); + ctx.change_font_size(FONT_SIZE_STEP); }, Action::DecreaseFontSize => { - ctx.change_font_size(-1); + ctx.change_font_size(-FONT_SIZE_STEP); } Action::ResetFontSize => { ctx.reset_font_size(); @@ -698,7 +700,7 @@ mod tests { fn last_modifiers(&mut self) -> &mut ModifiersState { &mut self.last_modifiers } - fn change_font_size(&mut self, _delta: i8) { + fn change_font_size(&mut self, _delta: f32) { } fn reset_font_size(&mut self) { } diff --git a/src/term/mod.rs b/src/term/mod.rs index 4f56e7fc..27cc9312 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -30,6 +30,7 @@ use selection::{self, Span, Selection}; use config::{Config, VisualBellAnimation}; use {MouseCursor, Rgb}; use copypasta::{Clipboard, Load, Store}; +use input::FONT_SIZE_STEP; pub mod cell; pub mod color; @@ -841,10 +842,10 @@ impl Term { } } - pub fn change_font_size(&mut self, delta: i8) { - // Saturating addition with minimum font size 1 - let new_size = self.font_size + Size::new(f32::from(delta)); - self.font_size = max(new_size, Size::new(1.)); + pub fn change_font_size(&mut self, delta: f32) { + // Saturating addition with minimum font size FONT_SIZE_STEP + let new_size = self.font_size + Size::new(delta); + self.font_size = max(new_size, Size::new(FONT_SIZE_STEP)); self.dirty = true; } @@ -1947,6 +1948,9 @@ mod tests { use ansi::{Handler, CharsetIndex, StandardCharset}; use selection::Selection; use std::mem; + use input::FONT_SIZE_STEP; + use font::Size; + use config::Config; #[test] fn semantic_selection_works() { @@ -2052,6 +2056,72 @@ mod tests { assert_eq!(term.grid()[&cursor].c, '▒'); } + + fn change_font_size_works(font_size: f32) { + let size = SizeInfo { + width: 21.0, + height: 51.0, + cell_width: 3.0, + cell_height: 3.0, + padding_x: 0.0, + padding_y: 0.0, + }; + let config: Config = Default::default(); + let mut term: Term = Term::new(&config, size); + term.change_font_size(font_size); + + let expected_font_size: Size = config.font().size() + Size::new(font_size); + assert_eq!(term.font_size, expected_font_size); + } + + #[test] + fn increase_font_size_works() { + change_font_size_works(10.0); + } + + #[test] + fn decrease_font_size_works() { + change_font_size_works(-10.0); + } + + #[test] + fn prevent_font_below_threshold_works() { + let size = SizeInfo { + width: 21.0, + height: 51.0, + cell_width: 3.0, + cell_height: 3.0, + padding_x: 0.0, + padding_y: 0.0, + }; + let config: Config = Default::default(); + let mut term: Term = Term::new(&config, size); + + term.change_font_size(-100.0); + + let expected_font_size: Size = Size::new(FONT_SIZE_STEP); + assert_eq!(term.font_size, expected_font_size); + } + + #[test] + fn reset_font_size_works() { + let size = SizeInfo { + width: 21.0, + height: 51.0, + cell_width: 3.0, + cell_height: 3.0, + padding_x: 0.0, + padding_y: 0.0, + }; + let config: Config = Default::default(); + let mut term: Term = Term::new(&config, size); + + term.change_font_size(10.0); + term.reset_font_size(); + + let expected_font_size: Size = config.font().size(); + assert_eq!(term.font_size, expected_font_size); + } } #[cfg(all(test, feature = "bench"))] From 0f700a01bd73623cdfc0afc4a54f9e82f46d8f49 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 16 Jun 2018 10:11:47 +0000 Subject: [PATCH 04/32] Add Copy/Cut/Paste keys This just adds support for the Copy/Cut/Paste keys and sets up Copy/Paste as alternative defaults for Ctrl+Shift+C/V. --- alacritty.yml | 2 ++ alacritty_macos.yml | 2 ++ src/config.rs | 6 ++++++ 3 files changed, 10 insertions(+) diff --git a/alacritty.yml b/alacritty.yml index 6290edfa..1b59434f 100644 --- a/alacritty.yml +++ b/alacritty.yml @@ -292,6 +292,8 @@ live_config_reload: true key_bindings: - { key: V, mods: Control|Shift, action: Paste } - { key: C, mods: Control|Shift, action: Copy } + - { key: Paste, action: Paste } + - { key: Copy, action: Copy } - { key: Q, mods: Command, action: Quit } - { key: W, mods: Command, action: Quit } - { key: Insert, mods: Shift, action: PasteSelection } diff --git a/alacritty_macos.yml b/alacritty_macos.yml index eff28e3e..19590842 100644 --- a/alacritty_macos.yml +++ b/alacritty_macos.yml @@ -267,6 +267,8 @@ live_config_reload: true key_bindings: - { key: V, mods: Command, action: Paste } - { key: C, mods: Command, action: Copy } + - { key: Paste, action: Paste } + - { key: Copy, action: Copy } - { key: Q, mods: Command, action: Quit } - { key: W, mods: Command, action: Quit } - { key: Home, chars: "\x1bOH", mode: AppCursor } diff --git a/src/config.rs b/src/config.rs index a8034139..88a14b22 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1889,6 +1889,9 @@ enum Key { WebStop, Yen, Caret, + Copy, + Paste, + Cut, } impl Key { @@ -2047,6 +2050,9 @@ impl Key { Key::WebStop => WebStop, Key::Yen => Yen, Key::Caret => Caret, + Key::Copy => Copy, + Key::Paste => Paste, + Key::Cut => Cut, } } } From 5ba34d4f9766a55a06ed5e3e44cc384af1b09f65 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sun, 17 Jun 2018 09:19:30 +0000 Subject: [PATCH 05/32] Move to cargo clippy Using clippy as a library has been deprecated, instead the `cargo clippy` command should be used instead. To comply with this change clippy has been removed from the `Cargo.toml` and is now installed with cargo when building in CI. This has also lead to a few new clippy issues to show up, this includes everything in the `font` subdirectory. This has been fixed and `font` should now be covered by clippy CI too. This also upgrades all dependencies, as a result this fixes #1341 and this fixes #1344. --- .travis.yml | 14 +- Cargo.lock | 540 +++++++++++----------------------- Cargo.toml | 1 - font/Cargo.lock | 224 ++++++++++++++ font/src/darwin/byte_order.rs | 4 +- font/src/darwin/mod.rs | 51 ++-- font/src/ft/fc/char_set.rs | 8 +- font/src/ft/fc/config.rs | 2 +- font/src/ft/fc/object_set.rs | 9 +- font/src/ft/fc/pattern.rs | 38 ++- font/src/ft/mod.rs | 30 +- font/src/lib.rs | 37 ++- src/config.rs | 2 +- src/lib.rs | 8 +- src/locale.rs | 1 + src/logging.rs | 2 +- src/main.rs | 7 +- src/tty.rs | 2 +- 18 files changed, 512 insertions(+), 468 deletions(-) create mode 100644 font/Cargo.lock diff --git a/.travis.yml b/.travis.yml index f5356354..2b6192d7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,18 +12,22 @@ rust: - nightly env: - - FEATURES="clippy" - - FEATURES="" + - CLIPPY="true" + - CLIPPY="" + +install: + - if [ -n "$CLIPPY" ]; then cargo install -f clippy; fi matrix: fast_finish: true exclude: - rust: stable - env: FEATURES="clippy" + env: CLIPPY="true" - rust: nightly - env: FEATURES="" + env: CLIPPY="" allow_failures: - rust: nightly script: - - cargo test --no-default-features --features "$FEATURES" + - if [ -n "$CLIPPY" ]; then cargo clippy; fi + - if [ -z "$CLIPPY" ]; then cargo test; fi diff --git a/Cargo.lock b/Cargo.lock index 0af2d395..da529458 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,11 +11,10 @@ name = "alacritty" version = "0.1.0" dependencies = [ "arraydeque 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "base64 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "cgmath 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)", - "clippy 0.0.205 (registry+https://github.com/rust-lang/crates.io-index)", "copypasta 0.0.1", "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "errno 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -23,20 +22,20 @@ dependencies = [ "font 0.1.0", "gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "glutin 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)", "mio-more 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "notify 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_yaml 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_yaml 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "vte 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "x11-dl 2.17.5 (registry+https://github.com/rust-lang/crates.io-index)", + "x11-dl 2.18.0 (registry+https://github.com/rust-lang/crates.io-index)", "xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -50,7 +49,7 @@ name = "ansi_term" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -68,36 +67,14 @@ name = "atty" version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "backtrace" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "backtrace-sys 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "backtrace-sys" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "base64" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -119,11 +96,6 @@ name = "bitflags" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "bitflags" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "bitflags" version = "1.0.3" @@ -144,21 +116,9 @@ name = "bytes" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "cargo_metadata" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "cc" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -172,7 +132,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "gleam 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -199,45 +159,12 @@ dependencies = [ "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "clippy" -version = "0.0.205" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "clippy_lints 0.0.205 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "clippy_lints" -version = "0.0.205" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", - "if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "cmake" version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -248,7 +175,7 @@ dependencies = [ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -267,7 +194,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -276,7 +203,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -284,7 +211,7 @@ name = "core-foundation-sys" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -300,7 +227,7 @@ dependencies = [ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -311,7 +238,7 @@ dependencies = [ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -322,7 +249,7 @@ dependencies = [ "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -343,11 +270,6 @@ name = "dtoa" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "either" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "env_logger" version = "0.5.10" @@ -355,7 +277,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", "humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -366,18 +288,10 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "error-chain" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "backtrace 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "euclid" version = "0.17.3" @@ -401,8 +315,8 @@ version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -421,8 +335,8 @@ dependencies = [ "euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "freetype-rs 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "servo-fontconfig 0.4.0 (git+https://github.com/jwilm/rust-fontconfig?branch=updated-2017-10-8)", ] @@ -446,7 +360,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "freetype-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -454,7 +368,7 @@ name = "freetype-sys" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -466,7 +380,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "fsevent-sys 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -474,7 +388,7 @@ name = "fsevent-sys" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -491,18 +405,13 @@ name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "getopts" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "gl_generator" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "khronos_api 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -525,15 +434,15 @@ dependencies = [ "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", "gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "shared_library 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "winit 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", - "x11-dl 2.17.5 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winit 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", + "x11-dl 2.18.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -544,27 +453,12 @@ dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "idna" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "if_chain" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "inotify" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -572,18 +466,10 @@ name = "iovec" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "itertools" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "itoa" version = "0.4.1" @@ -605,7 +491,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "lazy_static" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -620,7 +506,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.41" +version = "0.2.42" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -628,8 +514,8 @@ name = "libloading" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -637,8 +523,8 @@ name = "libz-sys" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -653,12 +539,12 @@ name = "log" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "log" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -669,20 +555,15 @@ name = "malloc_buf" version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "matches" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "memchr" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -690,8 +571,8 @@ name = "memmap" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -700,7 +581,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", @@ -720,8 +601,8 @@ dependencies = [ "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -767,8 +648,8 @@ version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -777,7 +658,19 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nix" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -791,7 +684,7 @@ dependencies = [ "fsevent-sys 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "inotify 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -849,7 +742,7 @@ name = "owning_ref" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -866,10 +759,10 @@ name = "parking_lot_core" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -884,37 +777,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "proc-macro2" -version = "0.4.3" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "pulldown-cmark" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", - "getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "quick-error" version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "quine-mc_cluskey" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "quote" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -923,13 +802,13 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "redox_syscall" -version = "0.1.38" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -937,7 +816,7 @@ name = "redox_termios" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "redox_syscall 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -947,14 +826,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "regex-syntax" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -965,20 +844,7 @@ name = "remove_dir_all" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc_version" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -991,56 +857,42 @@ name = "same-file" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "serde" -version = "1.0.62" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "serde_derive" -version = "1.0.62" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_yaml" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1049,7 +901,7 @@ name = "servo-fontconfig" version = "0.4.0" source = "git+https://github.com/jwilm/rust-fontconfig?branch=updated-2017-10-8#be2b94de833ec69cf767186262a5fb8360fa5b45" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "servo-fontconfig-sys 4.0.3 (git+https://github.com/jwilm/libfontconfig?branch=updated-2017-10-8)", ] @@ -1068,8 +920,8 @@ name = "shared_library" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1094,23 +946,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "smithay-client-toolkit" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-commons 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-protocols 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-commons 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-protocols 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "stable_deref_trait" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1120,11 +973,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.14.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", - "quote 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1133,11 +986,11 @@ name = "tempfile" version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1153,8 +1006,8 @@ name = "termion" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1171,7 +1024,7 @@ name = "thread_local" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1180,17 +1033,9 @@ name = "time" version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "toml" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "serde 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1198,19 +1043,6 @@ name = "ucd-util" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "unicode-bidi" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "unicode-width" version = "0.1.5" @@ -1229,16 +1061,6 @@ dependencies = [ "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "url" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", - "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "utf8-ranges" version = "1.0.0" @@ -1278,45 +1100,45 @@ version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wayland-client" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-commons 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-scanner 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-sys 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-commons 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-scanner 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-sys 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wayland-commons" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-sys 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-sys 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wayland-protocols" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-commons 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-scanner 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-sys 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-commons 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-scanner 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-sys 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wayland-scanner" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1324,11 +1146,11 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.20.8" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1338,7 +1160,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1365,27 +1187,27 @@ name = "wincolor" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "winit" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "cocoa 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "core-graphics 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "smithay-client-toolkit 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "wayland-client 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "x11-dl 2.17.5 (registry+https://github.com/rust-lang/crates.io-index)", + "smithay-client-toolkit 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "wayland-client 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "x11-dl 2.18.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1399,11 +1221,11 @@ dependencies = [ [[package]] name = "x11-dl" -version = "2.17.5" +version = "2.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1435,25 +1257,19 @@ dependencies = [ "checksum approx 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08abcc3b4e9339e33a3d0a5ed15d84a687350c05689d825e0f6655eef9e76a94" "checksum arraydeque 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bc059aa8598b9f4fb1dd532a061edc8e4efe0ccc55ba05358aba2a80b7b01f11" "checksum atty 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2fc4a1aa4c24c0718a250f0681885c1af91419d242f29eb8f2ab28502d80dbd1" -"checksum backtrace 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbdd17cd962b570302f5297aea8648d5923e22e555c2ed2d8b2e34eca646bf6d" -"checksum backtrace-sys 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5fd343a2466c4603f76f38de264bc0526cffc7fa38ba52fb9f13237eccc1ced2" -"checksum base64 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9263aa6a38da271eec5c91a83ce1e800f093c8535788d403d626d8d5c3f8f007" +"checksum base64 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "85415d2594767338a74a30c1d370b2f3262ec1b4ed2d7bba5b3faf4de40467d9" "checksum bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dead7461c1127cf637931a1e50934eb6eee8bff2f74433ac7909e9afcee04a3" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" "checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" -"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" "checksum block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" "checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9" "checksum bytes 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c129aff112dcc562970abb69e2508b40850dd24c274761bb50fb8a0067ba6c27" -"checksum cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ebd6272a2ca4fd39dbabbd6611eb03df45c2259b3b80b39a9ff8fbdcf42a4b3" -"checksum cc 1.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0ebb87d1116151416c0cf66a0e3fb6430cccd120fd6300794b4dfaa050ac40ba" +"checksum cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "49ec142f5768efb5b7622aebc3fdbdbb8950a4b9ba996393cb76ef7466e8747d" "checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18" "checksum cgl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "80f05e25f9631fdee56693110feda284a49308ca1e768857a0ad3906cfc1502a" "checksum cgmath 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)" = "64a4b57c8f4e3a2e9ac07e0f6abc9c24b6fc9e1b54c3478cfb598f3d0023e51c" "checksum clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f0f16b89cbb9ee36d87483dc939fe9f1e13c05898d56d7b230a0d4dff033a536" -"checksum clippy 0.0.205 (registry+https://github.com/rust-lang/crates.io-index)" = "bef3132dda284aba0f5630374566e98095c306d9ae49c4f7ede99347c4343fbe" -"checksum clippy_lints 0.0.205 (registry+https://github.com/rust-lang/crates.io-index)" = "1dcb837d7510bf9e4e3b6f470c450c6d25e61116db5503a6f565bb6283860622" "checksum cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "95470235c31c726d72bf2e1f421adc1e65b9d561bf5529612cbe1a72da1467b3" "checksum cocoa 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b44bd25bd275e9d74a5dff8ca55f2fb66c9ad5e12170d58697701df21a56e0e" "checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980" @@ -1466,10 +1282,8 @@ dependencies = [ "checksum dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" "checksum downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "18df8ce4470c189d18aa926022da57544f31e154631eb4cfe796aea97051fe6c" "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" -"checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" "checksum env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0e6e40ebb0e66918a37b38c7acab4e10d299e0463fe2af5d29b9cc86710cfd2a" "checksum errno 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b2c858c42ac0b88532f48fca88b0ed947cad4f1f64d904bcd6c9f138f7b95d70" -"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" "checksum euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c95fd0d455f114291a3109286bd387bd423770058474a2d3f38b712cd661df60" "checksum expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c470ccb972f2088549b023db8029ed9da9426f5affbf9b62efff7009ab8ed5b1" "checksum filetime 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "714653f3e34871534de23771ac7b26e999651a0a228f47beb324dfdf1dd4b10f" @@ -1482,30 +1296,25 @@ dependencies = [ "checksum fsevent-sys 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1a772d36c338d07a032d5375a36f15f9a7043bf0cb8ce7cee658e037c6032874" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "b900c08c1939860ce8b54dc6a89e26e00c04c380fd0e09796799bd7f12861e05" "checksum gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a" "checksum gleam 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "12b793fcf40a23dd372f184c228ab3eb96f88c50bb4fba8319c483aa025a4e45" "checksum glutin 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "42fb2de780307bd2bedbe013bc585659a683e7c6307d0baa878aec3da9250fc1" "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e" -"checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d" -"checksum if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "61bb90bdd39e3af69b0172dfc6130f6cd6332bf040fbb9bdd4401d37adbd48b8" "checksum inotify 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887fcc180136e77a85e6a6128579a719027b1bab9b1c38ea4444244fe262c20c" "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" -"checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450" "checksum itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c069bbec61e1ca5a596166e55dfe4773ff745c3d16b700013bcaff9a6df2c682" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum khronos_api 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "037ab472c33f67b5fbd3e9163a2645319e5356fcd355efa6d4eb7fff4bbcb554" -"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d" +"checksum lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e6412c5e2ad9584b0b8e979393122026cdd6d2a80b933f890dcd694ddbe73739" "checksum lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce12306c4739d86ee97c23139f3a34ddf0387bbf181bc7929d287025a8c3ef6b" "checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef" -"checksum libc 0.2.41 (registry+https://github.com/rust-lang/crates.io-index)" = "ac8ebf8343a981e2fa97042b14768f02ed3e1d602eac06cae6166df3c8ced206" +"checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1" "checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2" "checksum libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "87f737ad6cc6fd6eefe3d9dc5412f1573865bded441300904d2f42269e140f16" "checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" +"checksum log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6fddaa003a65722a7fb9e26b0ce95921fe4ba590542ced664d8ce2fa26f9f3ac" "checksum malloc_buf 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" "checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" "checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff" "checksum mio 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a637d1ca14eacae06296a008fa7ad955347e34efcb5891cfd8ba05491a37907e" @@ -1514,6 +1323,7 @@ dependencies = [ "checksum miow 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3e690c5df6b2f60acd45d56378981e827ff8295562fc8d34f573deb267a59cd1" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum net2 0.2.32 (registry+https://github.com/rust-lang/crates.io-index)" = "9044faf1413a1057267be51b5afba8eb1090bd2231c693664aa1db716fe1eae0" +"checksum nix 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d37e713a259ff641624b6cb20e3b12b2952313ba36b6823c0f16e6cfd9e5de17" "checksum nix 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bfb3ddedaa14746434a02041940495bf11325c22f6d36125d3bdd56090d50a79" "checksum notify 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5c3812da3098f210a0bb440f9c008471a031aa4c1de07a264fdd75456c95a4eb" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" @@ -1527,27 +1337,21 @@ dependencies = [ "checksum parking_lot_core 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "4db1a8ccf734a7bce794cc19b3df06ed87ab2f3907036b693c68f56b4d4537fa" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "110d5ee3593dbb73f56294327fe5668bcc997897097cbc76b51e7aed3f52452f" -"checksum proc-macro2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a45f2f0ae0b5757f6fe9e68745ba25f5246aea3598984ed81d013865873c1f84" -"checksum pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d6fdf85cda6cadfae5428a54661d431330b312bc767ddbc57adbedc24da66e32" +"checksum proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "effdb53b25cdad54f8f48843d67398f7ef2e14f12c1b4cb4effc549a6462a4d6" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" -"checksum quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45" -"checksum quote 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9e53eeda07ddbd8b057dde66d9beded11d0dfda13f0db0769e6b71d6bcf2074e" +"checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035" "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" -"checksum redox_syscall 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "0a12d51a5b5fd700e6c757f15877685bfa04fd7eb60c108f01d045cafa0073c2" +"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "75ecf88252dce580404a22444fc7d626c01815debba56a7f4f536772a5ff19d3" -"checksum regex-syntax 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8f1ac0f60d675cc6cf13a20ec076568254472551051ad5dd050364d70671bf6b" +"checksum regex-syntax 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05b06a75f5217880fc5e905952a42750bf44787e56a6c6d6852ed0992f5e1d54" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" -"checksum rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "76d7ba1feafada44f2d38eed812bd2489a03c0f5abb975799251518b68848649" -"checksum rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a54aa04a10c68c1c4eacb4337fd883b435997ede17a9385784b990777686b09a" "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" "checksum same-file 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cfb6eded0b06a0b512c8ddbcf04089138c9b4362c2f696f3c3d76039d68f3637" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -"checksum serde 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)" = "44d9552562673a8ea8757f5b77ccd794b54dd6841d2def71e9936f293ee81c72" -"checksum serde_derive 1.0.62 (registry+https://github.com/rust-lang/crates.io-index)" = "9503e0851dc4398d7f7ee1da227f9c9b9cf82718eb239ab10847b1de6e2a5777" -"checksum serde_json 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "ee382a792fabc5d720630aeafe1a4c69abe3d32aaaa5dbba6762fd8246d1bbe3" -"checksum serde_yaml 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "107bb818146aaf922e7bbcf6a940f1db2f0dcf381779b451e400331b2c6f86db" +"checksum serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)" = "e9a2d9a9ac5120e0f768801ca2b58ad6eec929dc9d1d616c162f208869c2ce95" +"checksum serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)" = "0a90213fa7e0f5eac3f7afe2d5ff6b088af515052cc7303bd68c7e3b91a3fb79" +"checksum serde_json 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)" = "fc97cccc2959f39984524026d760c08ef0dd5f0f5948c8d31797dbfae458c875" +"checksum serde_yaml 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ef8099d3df28273c99a1728190c7a9f19d444c941044f64adf986bee7ec53051" "checksum servo-fontconfig 0.4.0 (git+https://github.com/jwilm/rust-fontconfig?branch=updated-2017-10-8)" = "" "checksum servo-fontconfig-sys 4.0.3 (git+https://github.com/jwilm/libfontconfig?branch=updated-2017-10-8)" = "" "checksum shared_library 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8254bf098ce4d8d7cc7cc6de438c5488adc5297e5b7ffef88816c0a91bd289c1" @@ -1555,24 +1359,20 @@ dependencies = [ "checksum slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17b4fcaed89ab08ef143da37bc52adbcc04d4a69014f4c1208d6b51f0c47bc23" "checksum slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fdeff4cd9ecff59ec7e3744cbca73dfe5ac35c2aedb2cfba8a1c715a18912e9d" "checksum smallvec 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03dab98ab5ded3a8b43b2c80751194608d0b2aa0f1d46cf95d1c35e192844aa7" -"checksum smithay-client-toolkit 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "92dd41b4a4a0679e5873f8e58b8191554d4dc0104d32a22ff09b678059327bd2" -"checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b" +"checksum smithay-client-toolkit 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "84c45607482d31161951f4ea11ba2673e3999e1cc6ca2d50a72eaee7eae3cbf1" +"checksum stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffbc596e092fe5f598b12ef46cc03754085ac2f4d8c739ad61c4ae266cc3b3fa" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" -"checksum syn 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "99d991a9e7c33123925e511baab68f7ec25c3795962fe326a2395e5a42a614f0" +"checksum syn 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c67da57e61ebc7b7b6fff56bb34440ca3a83db037320b0507af4c10368deda7d" "checksum tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47776f63b85777d984a50ce49d6b9e58826b6a3766a449fc95bc66cd5663c15b" "checksum termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "adc4587ead41bf016f11af03e55a624c06568b5a19db4e90fde573d805074f83" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" "checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" "checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b" -"checksum toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a0263c6c02c4db6c8f7681f9fd35e90de799ebd4cfdeab77a38f4ff6b3d8c0d9" "checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d" -"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -"checksum unicode-normalization 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6a0180bc61fc5a987082bfa111f4cc95c4caff7f9799f3e46df09163a937aa25" "checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" -"checksum url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f808aadd8cfec6ef90e4a14eb46f24511824d1ac596b9682703c87056c8678b7" "checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" "checksum utf8parse 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a15ea87f3194a3a454c78d79082b4f5e85f6956ddb6cb86bbfbe4892aa3c0323" "checksum vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7ed0f6789c8a85ca41bbc1c9d175422116a9869bd1cf31bb08e1493ecce60380" @@ -1580,20 +1380,20 @@ dependencies = [ "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum vte 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a01634c75db59478405de08d8567c40c578bba80c565217ee709934b551720d8" "checksum walkdir 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "63636bd0eb3d00ccb8b9036381b526efac53caf112b7783b730ab3f8e44da369" -"checksum wayland-client 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7de22033af9c568a9c91230c9c46358bc832308c76bf04884dab2f89dd75489c" -"checksum wayland-commons 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)" = "d3faac04ae4d5f42b86ed0b32cbedd3b212bd12b064258c2b8a10a43ec81a353" -"checksum wayland-protocols 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7a2dfff48d5f7d0be1de525db808e3dae429cbd0517b89244ee07ce0238612b2" -"checksum wayland-scanner 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)" = "0fb79019ceee53288e51e3657eec52d1ddda70f0a11e74ad7ad83789a3bdecf1" -"checksum wayland-sys 0.20.8 (registry+https://github.com/rust-lang/crates.io-index)" = "e47d1f8971491be2431996a326e81d78e56563d581d856c95195fff5bb738059" +"checksum wayland-client 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0f3ed65542a0be13ea0fdcc55c9a011fcc44c3882e6e1a9b4dfddb25182897dd" +"checksum wayland-commons 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4ac5c79f1d050f4047a82ddce77acda026c142c0023e7b7e20eea5ad76fb7dbf" +"checksum wayland-protocols 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)" = "be56e3d80559177a70bc78f9396fbe1705b7baed4951ae6e34d28bb59681b1a8" +"checksum wayland-scanner 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)" = "93cf4ef48caedf3fc1a9b2bf0df64e6d425bd628b85830a08432dd25b61de17c" +"checksum wayland-sys 0.20.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d2dbe7b51c16b8a8153806aaa21f346333074482bb57bc5cb059cc828f8c6842" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" +"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" "checksum wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb06499a3a4d44302791052df005d5232b927ed1a9658146d842165c4de7767" -"checksum winit 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "452e3331a6fb5b9d660efae533bf9ae022c528d36eb1e6278b37fc9319d58eff" +"checksum winit 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4bb6ea35de8bd722201914b28a33d503ee45b09fcf85fc4bbf574845e41f79e2" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -"checksum x11-dl 2.17.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3235540540fde1ae074c8df49054166c0e070407f1c6e1ee17b8c87c2c7bcc7d" +"checksum x11-dl 2.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "931d8584b49771143af0c422f372d8aef4280afd5920dad39b0a95a8e51df1e9" "checksum xdg 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a66b7c2281ebde13cf4391d70d4c7e5946c3c25e72a7b859ca8f677dcd0b0c61" "checksum xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2" "checksum yaml-rust 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57ab38ee1a4a266ed033496cf9af1828d8d6e6c1cfa5f643a2809effcae4d628" diff --git a/Cargo.toml b/Cargo.toml index 5c7f4f26..a316f4d7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,6 @@ fnv = "1" unicode-width = "0.1" arraydeque = "0.4" glutin = "0.16" -clippy = { version = "*", optional = true } env_logger = "0.5" base64 = "0.9.0" diff --git a/font/Cargo.lock b/font/Cargo.lock new file mode 100644 index 00000000..260ac8e0 --- /dev/null +++ b/font/Cargo.lock @@ -0,0 +1,224 @@ +[[package]] +name = "bitflags" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitflags" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cc" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cmake" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation-sys" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-graphics" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-text" +version = "9.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "euclid" +version = "0.17.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "expat-sys" +version = "2.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "font" +version = "0.1.0" +dependencies = [ + "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-text 9.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "freetype-rs 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "servo-fontconfig 0.4.0 (git+https://github.com/jwilm/rust-fontconfig?branch=updated-2017-10-8)", +] + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "freetype-rs" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "freetype-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "freetype-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libc" +version = "0.2.42" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libz-sys" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pkg-config" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "servo-fontconfig" +version = "0.4.0" +source = "git+https://github.com/jwilm/rust-fontconfig?branch=updated-2017-10-8#be2b94de833ec69cf767186262a5fb8360fa5b45" +dependencies = [ + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "servo-fontconfig-sys 4.0.3 (git+https://github.com/jwilm/libfontconfig?branch=updated-2017-10-8)", +] + +[[package]] +name = "servo-fontconfig-sys" +version = "4.0.3" +source = "git+https://github.com/jwilm/libfontconfig?branch=updated-2017-10-8#5c1845e1bffa11cf4d3e6fb27f456bf5c814ce1b" +dependencies = [ + "expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "freetype-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "vcpkg" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[metadata] +"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4" +"checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" +"checksum cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "49ec142f5768efb5b7622aebc3fdbdbb8950a4b9ba996393cb76ef7466e8747d" +"checksum cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "405216fd8fe65f718daa7102ea808a946b6ce40c742998fbfd3463645552de18" +"checksum cmake 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)" = "95470235c31c726d72bf2e1f421adc1e65b9d561bf5529612cbe1a72da1467b3" +"checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980" +"checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa" +"checksum core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb0ed45fdc32f9ab426238fba9407dfead7bacd7900c9b4dd3f396f46eafdae3" +"checksum core-text 9.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2bd581c37283d0c23311d179aefbb891f2324ee0405da58a26e8594ab76e5748" +"checksum euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c95fd0d455f114291a3109286bd387bd423770058474a2d3f38b712cd661df60" +"checksum expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c470ccb972f2088549b023db8029ed9da9426f5affbf9b62efff7009ab8ed5b1" +"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +"checksum freetype-rs 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a1418e2a055fec8efe18c1a90a54b2cf5e649e583830dd4c71226c4e3bc920c6" +"checksum freetype-sys 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eccfb6d96cac99921f0c2142a91765f6c219868a2c45bdfe7d65a08775f18127" +"checksum libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)" = "b685088df2b950fccadf07a7187c8ef846a959c142338a48f9dc0b94517eb5f1" +"checksum libz-sys 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "87f737ad6cc6fd6eefe3d9dc5412f1573865bded441300904d2f42269e140f16" +"checksum log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6fddaa003a65722a7fb9e26b0ce95921fe4ba590542ced664d8ce2fa26f9f3ac" +"checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +"checksum num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775393e285254d2f5004596d69bb8bc1149754570dcc08cf30cabeba67955e28" +"checksum pkg-config 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "110d5ee3593dbb73f56294327fe5668bcc997897097cbc76b51e7aed3f52452f" +"checksum servo-fontconfig 0.4.0 (git+https://github.com/jwilm/rust-fontconfig?branch=updated-2017-10-8)" = "" +"checksum servo-fontconfig-sys 4.0.3 (git+https://github.com/jwilm/libfontconfig?branch=updated-2017-10-8)" = "" +"checksum vcpkg 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7ed0f6789c8a85ca41bbc1c9d175422116a9869bd1cf31bb08e1493ecce60380" diff --git a/font/src/darwin/byte_order.rs b/font/src/darwin/byte_order.rs index 29efb5b1..2ea46fcb 100644 --- a/font/src/darwin/byte_order.rs +++ b/font/src/darwin/byte_order.rs @@ -24,7 +24,7 @@ pub const kCGBitmapByteOrder32Host: u32 = kCGBitmapByteOrder32Little; pub const kCGBitmapByteOrder32Host: u32 = kCGBitmapByteOrder32Big; #[cfg(target_endian = "little")] -pub fn extract_rgb(bytes: Vec) -> Vec { +pub fn extract_rgb(bytes: &[u8]) -> Vec { let pixels = bytes.len() / 4; let mut rgb = Vec::with_capacity(pixels * 3); @@ -32,7 +32,7 @@ pub fn extract_rgb(bytes: Vec) -> Vec { let offset = i * 4; rgb.push(bytes[offset + 2]); rgb.push(bytes[offset + 1]); - rgb.push(bytes[offset + 0]); + rgb.push(bytes[offset]); } rgb diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs index 14381113..843d75dd 100644 --- a/font/src/darwin/mod.rs +++ b/font/src/darwin/mod.rs @@ -132,8 +132,8 @@ impl ::Rasterize for Rasterizer { Ok(Rasterizer { fonts: HashMap::new(), keys: HashMap::new(), - device_pixel_ratio: device_pixel_ratio, - use_thin_strokes: use_thin_strokes, + device_pixel_ratio, + use_thin_strokes, }) } @@ -196,7 +196,7 @@ impl Rasterizer { for descriptor in descriptors { if descriptor.style_name == style { // Found the font we want - let scaled_size = size.as_f32_pts() as f64 * self.device_pixel_ratio as f64; + let scaled_size = f64::from(size.as_f32_pts()) * f64::from(self.device_pixel_ratio); let font = descriptor.to_font(scaled_size, true); return Ok(font); } @@ -220,7 +220,7 @@ impl Rasterizer { Slant::Normal => false, _ => true, }; - let scaled_size = size.as_f32_pts() as f64 * self.device_pixel_ratio as f64; + let scaled_size = f64::from(size.as_f32_pts()) * f64::from(self.device_pixel_ratio); let descriptors = descriptors_for_family(&desc.name[..]); for descriptor in descriptors { @@ -250,7 +250,7 @@ impl Rasterizer { font: &Font, ) -> Option> { let scaled_size = self.device_pixel_ratio * glyph.size.as_f32_pts(); - font.get_glyph(glyph.c, scaled_size as _, self.use_thin_strokes) + font.get_glyph(glyph.c, f64::from(scaled_size), self.use_thin_strokes) .map(|r| Some(Ok(r))) .unwrap_or_else(|e| match e { Error::MissingGlyph(_) => None, @@ -301,7 +301,7 @@ pub fn get_family_names() -> Vec { /// Return fallback descriptors for font/language list fn cascade_list_for_languages( ct_font: &CTFont, - languages: &Vec + languages: &[String] ) -> Vec { // convert language type &Vec -> CFArray @@ -368,12 +368,11 @@ impl Descriptor { // many chars. We add the symbols back in. // Investigate if we can actually use the .-prefixed // fallbacks somehow. - descriptors_for_family("Apple Symbols") - .into_iter() - .next() // should only have one element; use it - .map(|descriptor| { - fallbacks.push(descriptor.to_font(size, false)) - }); + if let Some(descriptor) = + descriptors_for_family("Apple Symbols").into_iter().next() + { + fallbacks.push(descriptor.to_font(size, false)) + }; // Include Menlo in the fallback list as well fallbacks.insert(0, Font { @@ -390,9 +389,9 @@ impl Descriptor { }; Font { - ct_font: ct_font, - cg_font: cg_font, - fallbacks: fallbacks, + ct_font, + cg_font, + fallbacks, } } } @@ -424,8 +423,8 @@ impl Font { let line_height = (ascent + descent + leading + 0.5).floor(); Metrics { - average_advance: average_advance, - line_height: line_height, + average_advance, + line_height, descent: -(self.ct_font.descent() as f32), } } @@ -482,13 +481,13 @@ impl Font { } let glyph_index = self.glyph_index(character) - .ok_or(Error::MissingGlyph(character))?; + .ok_or_else(|| Error::MissingGlyph(character))?; let bounds = self.bounding_rect_for_glyph(Default::default(), glyph_index); let rasterized_left = bounds.origin.x.floor() as i32; let rasterized_width = - (bounds.origin.x - (rasterized_left as f64) + bounds.size.width).ceil() as u32; + (bounds.origin.x - f64::from(rasterized_left) + bounds.size.width).ceil() as u32; let rasterized_descent = (-bounds.origin.y).ceil() as i32; let rasterized_ascent = (bounds.size.height + bounds.origin.y).ceil() as i32; let rasterized_height = (rasterized_descent + rasterized_ascent) as u32; @@ -519,8 +518,8 @@ impl Font { let context_rect = CGRect::new( &CGPoint::new(0.0, 0.0), &CGSize::new( - rasterized_width as f64, - rasterized_height as f64 + f64::from(rasterized_width), + f64::from(rasterized_height) ) ); @@ -542,8 +541,8 @@ impl Font { // Set fill color to white for drawing the glyph cg_context.set_rgb_fill_color(1.0, 1.0, 1.0, 1.0); let rasterization_origin = CGPoint { - x: -rasterized_left as f64, - y: rasterized_descent as f64, + x: f64::from(-rasterized_left), + y: f64::from(rasterized_descent), }; self.ct_font.draw_glyphs(&[glyph_index as CGGlyph], @@ -552,7 +551,7 @@ impl Font { let rasterized_pixels = cg_context.data().to_vec(); - let buf = extract_rgb(rasterized_pixels); + let buf = extract_rgb(&rasterized_pixels); Ok(RasterizedGlyph { c: character, @@ -560,7 +559,7 @@ impl Font { top: (bounds.size.height + bounds.origin.y).ceil() as i32, width: rasterized_width as i32, height: rasterized_height as i32, - buf: buf, + buf, }) } @@ -585,7 +584,7 @@ impl Font { ); if res { - Some(glyphs[0] as u32) + Some(u32::from(glyphs[0])) } else { None } diff --git a/font/src/ft/fc/char_set.rs b/font/src/ft/fc/char_set.rs index e6fe027a..151d14a3 100644 --- a/font/src/ft/fc/char_set.rs +++ b/font/src/ft/fc/char_set.rs @@ -24,7 +24,13 @@ foreign_type! { } impl CharSet { - pub fn new() -> CharSet { + pub fn new() -> Self { + Self::default() + } +} + +impl Default for CharSet { + fn default() -> Self { CharSet(unsafe { FcCharSetCreate() }) } } diff --git a/font/src/ft/fc/config.rs b/font/src/ft/fc/config.rs index 92993fe8..9744b37a 100644 --- a/font/src/ft/fc/config.rs +++ b/font/src/ft/fc/config.rs @@ -38,7 +38,7 @@ impl Config { impl ConfigRef { /// Returns one of the two sets of fonts from the configuration as /// specified by `set`. - pub fn get_fonts<'a>(&'a self, set: SetName) -> &'a FontSetRef { + pub fn get_fonts(&self, set: SetName) -> &FontSetRef { unsafe { let ptr = FcConfigGetFonts(self.as_ptr(), set as u32); FontSetRef::from_ptr(ptr) diff --git a/font/src/ft/fc/object_set.rs b/font/src/ft/fc/object_set.rs index 42e03f64..47d11674 100644 --- a/font/src/ft/fc/object_set.rs +++ b/font/src/ft/fc/object_set.rs @@ -24,8 +24,13 @@ foreign_type! { } impl ObjectSet { - #[allow(dead_code)] - pub fn new() -> ObjectSet { + pub fn new() -> Self { + Self::default() + } +} + +impl Default for ObjectSet { + fn default() -> Self { ObjectSet(unsafe { FcObjectSetCreate() }) diff --git a/font/src/ft/fc/pattern.rs b/font/src/ft/fc/pattern.rs index 592d3859..bb0c4c38 100644 --- a/font/src/ft/fc/pattern.rs +++ b/font/src/ft/fc/pattern.rs @@ -39,8 +39,8 @@ pub struct StringPropertyIter<'a> { impl<'a> StringPropertyIter<'a> { fn new<'b>(pattern: &'b PatternRef, object: &'b [u8]) -> StringPropertyIter<'b> { StringPropertyIter { - pattern: pattern, - object: object, + pattern, + object, index: 0 } } @@ -82,8 +82,8 @@ pub struct BooleanPropertyIter<'a> { impl<'a> BooleanPropertyIter<'a> { fn new<'b>(pattern: &'b PatternRef, object: &'b [u8]) -> BooleanPropertyIter<'b> { BooleanPropertyIter { - pattern: pattern, - object: object, + pattern, + object, index: 0 } } @@ -101,7 +101,7 @@ impl<'a> BooleanPropertyIter<'a> { }; if result == FcResultMatch { - Some(!(value == 0)) + Some(value != 0) } else { None } @@ -118,8 +118,8 @@ pub struct IntPropertyIter<'a> { impl<'a> IntPropertyIter<'a> { fn new<'b>(pattern: &'b PatternRef, object: &'b [u8]) -> IntPropertyIter<'b> { IntPropertyIter { - pattern: pattern, - object: object, + pattern, + object, index: 0 } } @@ -171,7 +171,7 @@ pub struct HintStylePropertyIter<'a> { } impl<'a> HintStylePropertyIter<'a> { - fn new<'b>(pattern: &'b PatternRef) -> HintStylePropertyIter<'b> { + fn new(pattern: &PatternRef) -> HintStylePropertyIter { HintStylePropertyIter { inner: IntPropertyIter::new(pattern, b"hintstyle\0") } @@ -201,7 +201,7 @@ pub struct LcdFilterPropertyIter<'a> { } impl<'a> LcdFilterPropertyIter<'a> { - fn new<'b>(pattern: &'b PatternRef) -> LcdFilterPropertyIter<'b> { + fn new(pattern: &PatternRef) -> LcdFilterPropertyIter { LcdFilterPropertyIter { inner: IntPropertyIter::new(pattern, b"lcdfilter\0") } @@ -236,14 +236,14 @@ pub struct DoublePropertyIter<'a> { impl<'a> DoublePropertyIter<'a> { fn new<'b>(pattern: &'b PatternRef, object: &'b [u8]) -> DoublePropertyIter<'b> { DoublePropertyIter { - pattern: pattern, - object: object, + pattern, + object, index: 0 } } fn get_value(&self, index: usize) -> Option { - let mut value = 0 as c_double; + let mut value = f64::from(0); let result = unsafe { FcPatternGetDouble( @@ -379,7 +379,13 @@ macro_rules! string_accessor { } impl Pattern { - pub fn new() -> Pattern { + pub fn new() -> Self { + Self::default() + } +} + +impl Default for Pattern { + fn default() -> Self { Pattern(unsafe { FcPatternCreate() }) } } @@ -483,11 +489,11 @@ impl PatternRef { BooleanPropertyIter::new(self, object) } - pub fn hintstyle<'a>(&'a self) -> HintStylePropertyIter<'a> { + pub fn hintstyle(&self) -> HintStylePropertyIter { HintStylePropertyIter::new(self) } - pub fn lcdfilter<'a>(&'a self) -> LcdFilterPropertyIter<'a> { + pub fn lcdfilter(&self) -> LcdFilterPropertyIter { LcdFilterPropertyIter::new(self) } @@ -565,7 +571,7 @@ impl PatternRef { RgbaPropertyIter::new(self, b"rgba\0") } - pub fn set_rgba(&self, rgba: Rgba) -> bool { + pub fn set_rgba(&self, rgba: &Rgba) -> bool { unsafe { self.add_integer(b"rgba\0", rgba.to_isize()) } diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs index 68d2faf3..7c5fb768 100644 --- a/font/src/ft/mod.rs +++ b/font/src/ft/mod.rs @@ -80,8 +80,8 @@ impl ::Rasterize for FreeTypeRasterizer { Ok(FreeTypeRasterizer { faces: HashMap::new(), keys: HashMap::new(), - library: library, - device_pixel_ratio: device_pixel_ratio, + library, + device_pixel_ratio, }) } @@ -94,7 +94,7 @@ impl ::Rasterize for FreeTypeRasterizer { Ok(Metrics { average_advance: full.cell_width, line_height: height, - descent: descent, + descent, }) } @@ -172,7 +172,7 @@ impl FreeTypeRasterizer { } as f64; Ok(FullMetrics { - size_metrics: size_metrics, + size_metrics, cell_width: width }) } @@ -188,7 +188,7 @@ impl FreeTypeRasterizer { pattern.add_family(&desc.name); pattern.set_weight(weight.into_fontconfig_type()); pattern.set_slant(slant.into_fontconfig_type()); - pattern.add_pixelsize(size.as_f32_pts() as _); + pattern.add_pixelsize(f64::from(size.as_f32_pts())); let font = fc::font_match(fc::Config::get_current(), &mut pattern) .ok_or_else(|| Error::MissingFont(desc.to_owned()))?; @@ -210,7 +210,7 @@ impl FreeTypeRasterizer { let mut pattern = fc::Pattern::new(); pattern.add_family(&desc.name); pattern.add_style(style); - pattern.add_pixelsize(size.as_f32_pts() as _); + pattern.add_pixelsize(f64::from(size.as_f32_pts())); let font = fc::font_match(fc::Config::get_current(), &mut pattern) .ok_or_else(|| Error::MissingFont(desc.to_owned()))?; @@ -244,12 +244,12 @@ impl FreeTypeRasterizer { }; let face = Face { - ft_face: ft_face, + ft_face, key: FontKey::next(), load_flags: Self::ft_load_flags(pattern), render_mode: Self::ft_render_mode(pattern), lcd_filter: Self::ft_lcd_filter(pattern), - non_scalable: non_scalable, + non_scalable, }; debug!("Loaded Face {:?}", face); @@ -269,14 +269,10 @@ impl FreeTypeRasterizer { let use_initial_face = if self.faces.contains_key(&glyph_key.font_key) { // Get face and unwrap since we just checked for presence. - let face = self.faces.get(&glyph_key.font_key).unwrap(); + let face = &self.faces[&glyph_key.font_key]; let index = face.ft_face.get_char_index(c as usize); - if index != 0 || have_recursed { - true - } else { - false - } + index != 0 || have_recursed } else { false }; @@ -334,7 +330,7 @@ impl FreeTypeRasterizer { // Render a normal character if it's not a cursor let font_key = self.face_for_glyph(glyph_key, false)?; - let face = self.faces.get(&font_key).unwrap(); + let face = &self.faces[&font_key]; let index = face.ft_face.get_char_index(glyph_key.c as usize); let size = face.non_scalable.as_ref() @@ -360,7 +356,7 @@ impl FreeTypeRasterizer { left: glyph.bitmap_left(), width: pixel_width, height: glyph.bitmap().rows(), - buf: buf, + buf, }) } @@ -490,7 +486,7 @@ impl FreeTypeRasterizer { } Ok((bitmap.width(), packed)) }, - mode @ _ => panic!("unhandled pixel mode: {:?}", mode) + mode => panic!("unhandled pixel mode: {:?}", mode) } } diff --git a/font/src/lib.rs b/font/src/lib.rs index 330ed362..05680da2 100644 --- a/font/src/lib.rs +++ b/font/src/lib.rs @@ -116,7 +116,7 @@ impl FontDesc { { FontDesc { name: name.into(), - style: style + style, } } } @@ -146,7 +146,7 @@ impl FontKey { } } -#[derive(Debug, Copy, Clone, PartialEq, Eq)] +#[derive(Debug, Copy, Clone, Eq)] pub struct GlyphKey { pub c: char, pub font_key: FontKey, @@ -165,6 +165,19 @@ impl Hash for GlyphKey { } } +impl PartialEq for GlyphKey { + fn eq(&self, other: &Self) -> bool { + unsafe { + // This transmute is fine: + // + // - If GlyphKey ever becomes a different size, this will fail to compile + // - Result is being used for equality checking and has no fields (it's a u64) + let other = ::std::mem::transmute::(*other); + ::std::mem::transmute::(*self).eq(&other) + } + } +} + /// Font size stored as integer #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct Size(i16); @@ -183,7 +196,7 @@ impl Size { /// Get the f32 size in points pub fn as_f32_pts(self) -> f32 { - self.0 as f32 / Size::factor() + f32::from(self.0) / Size::factor() } } @@ -224,14 +237,14 @@ pub fn get_underline_cursor_glyph(descent: i32, width: i32) -> Result(&'a [u8]); diff --git a/src/config.rs b/src/config.rs index 88a14b22..ed69ec5d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1735,7 +1735,7 @@ mod tests { } } -#[cfg_attr(feature = "clippy", allow(enum_variant_names))] +#[cfg_attr(feature = "cargo-clippy", allow(enum_variant_names))] #[derive(Deserialize, Copy, Clone)] enum Key { Key1, diff --git a/src/lib.rs b/src/lib.rs index a8e18451..afbd8595 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,12 +13,7 @@ // limitations under the License. // //! Alacritty - The GPU Enhanced Terminal -#![cfg_attr(feature = "clippy", feature(plugin))] -#![cfg_attr(feature = "clippy", plugin(clippy))] -#![cfg_attr(feature = "clippy", deny(clippy))] -#![cfg_attr(feature = "clippy", deny(enum_glob_use))] -#![cfg_attr(feature = "clippy", deny(if_not_else))] -#![cfg_attr(feature = "clippy", deny(wrong_pub_self_convention))] +#![cfg_attr(feature = "cargo-clippy", deny(clippy, if_not_else, enum_glob_use, wrong_pub_self_convention))] #![cfg_attr(feature = "nightly", feature(core_intrinsics))] #![cfg_attr(all(test, feature = "bench"), feature(test))] @@ -121,5 +116,6 @@ impl Mul for Rgb { #[allow(unused_mut)] pub mod gl { #![allow(non_upper_case_globals)] + #![cfg_attr(feature = "cargo-clippy", allow(clippy))] include!(concat!(env!("OUT_DIR"), "/gl_bindings.rs")); } diff --git a/src/locale.rs b/src/locale.rs index 9fcd2db2..bea68cad 100644 --- a/src/locale.rs +++ b/src/locale.rs @@ -11,6 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +#![cfg_attr(feature = "cargo-clippy", allow(let_unit_value))] #![cfg(target_os = "macos")] use libc::{LC_CTYPE, setlocale}; use std::ffi::{CString, CStr}; diff --git a/src/logging.rs b/src/logging.rs index 5691eb78..a691778a 100644 --- a/src/logging.rs +++ b/src/logging.rs @@ -29,7 +29,7 @@ pub struct Logger { impl Logger { // False positive, see: https://github.com/rust-lang-nursery/rust-clippy/issues/734 - #[cfg_attr(feature = "clippy", allow(new_ret_no_self))] + #[cfg_attr(feature = "cargo-clippy", allow(new_ret_no_self))] pub fn new(output: T, level: log::LevelFilter) -> Logger> { log::set_max_level(level); Logger { diff --git a/src/main.rs b/src/main.rs index c45dfda5..b0e507e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,12 +13,7 @@ // limitations under the License. // //! Alacritty - The GPU Enhanced Terminal -#![cfg_attr(feature = "clippy", feature(plugin))] -#![cfg_attr(feature = "clippy", plugin(clippy))] -#![cfg_attr(feature = "clippy", deny(clippy))] -#![cfg_attr(feature = "clippy", deny(enum_glob_use))] -#![cfg_attr(feature = "clippy", deny(if_not_else))] -#![cfg_attr(feature = "clippy", deny(wrong_pub_self_convention))] +#![cfg_attr(feature = "cargo-clippy", deny(clippy, if_not_else, enum_glob_use, wrong_pub_self_convention))] #![cfg_attr(feature = "nightly", feature(core_intrinsics))] #![cfg_attr(all(test, feature = "bench"), feature(test))] diff --git a/src/tty.rs b/src/tty.rs index 166a788e..4da11c0e 100644 --- a/src/tty.rs +++ b/src/tty.rs @@ -117,7 +117,7 @@ fn set_controlling_terminal(fd: c_int) { // based on architecture (32/64). So a generic cast is used to make sure // there are no issues. To allow such a generic cast the clippy warning // is disabled. - #[cfg_attr(feature = "clippy", allow(cast_lossless))] + #[cfg_attr(feature = "cargo-clippy", allow(cast_lossless))] libc::ioctl(fd, TIOCSCTTY as _, 0) }; From f55252ec8537e68d0c98a1fac35728a2b596d328 Mon Sep 17 00:00:00 2001 From: Nathan Lilienthal Date: Mon, 18 Jun 2018 01:26:54 -0400 Subject: [PATCH 06/32] Override dynamic_title when --title is specified --- src/cli.rs | 24 ++++++++---------------- src/config.rs | 30 ++++++++++++++++++++++++++++++ src/main.rs | 4 ++-- src/window.rs | 23 +++++++++++++++++++++-- 4 files changed, 61 insertions(+), 20 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index e57caf0d..92b83f6c 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -18,17 +18,14 @@ use config::{Dimensions, Shell}; use std::path::{Path, PathBuf}; use std::borrow::Cow; -const DEFAULT_TITLE: &str = "Alacritty"; -const DEFAULT_CLASS: &str = "Alacritty"; - /// Options specified on the command line pub struct Options { pub live_config_reload: Option, pub print_events: bool, pub ref_test: bool, pub dimensions: Option, - pub title: String, - pub class: String, + pub title: Option, + pub class: Option, pub log_level: log::LevelFilter, pub command: Option>, pub working_dir: Option, @@ -42,8 +39,8 @@ impl Default for Options { print_events: false, ref_test: false, dimensions: None, - title: DEFAULT_TITLE.to_owned(), - class: DEFAULT_CLASS.to_owned(), + title: None, + class: None, log_level: log::LevelFilter::Warn, command: None, working_dir: None, @@ -82,11 +79,11 @@ impl Options { .arg(Arg::with_name("title") .long("title") .short("t") - .default_value(DEFAULT_TITLE) + .takes_value(true) .help("Defines the window title")) .arg(Arg::with_name("class") .long("class") - .default_value(DEFAULT_CLASS) + .takes_value(true) .help("Defines window class on X11")) .arg(Arg::with_name("q") .short("q") @@ -139,13 +136,8 @@ impl Options { } } - if let Some(title) = matches.value_of("title") { - options.title = title.to_owned(); - } - - if let Some(class) = matches.value_of("class") { - options.class = class.to_owned(); - } + options.class = matches.value_of("class").map(|c| c.to_owned()); + options.title = matches.value_of("title").map(|t| t.to_owned()); match matches.occurrences_of("q") { 0 => {}, diff --git a/src/config.rs b/src/config.rs index ed69ec5d..539edb61 100644 --- a/src/config.rs +++ b/src/config.rs @@ -23,6 +23,7 @@ use notify::{Watcher, watcher, DebouncedEvent, RecursiveMode}; use glutin::ModifiersState; +use cli::Options; use input::{Action, Binding, MouseBinding, KeyBinding}; use index::{Line, Column}; use ansi::CursorStyle; @@ -1383,6 +1384,14 @@ impl Config { Ok(config) } + /// Overrides the `dynamic_title` configuration based on `--title`. + pub fn update_dynamic_title(mut self, options: &Options) -> Self { + if options.title.is_some() { + self.dynamic_title = false; + } + self + } + fn read_file>(path: P) -> Result { let mut f = fs::File::open(path)?; let mut contents = String::new(); @@ -1713,6 +1722,7 @@ impl Monitor { #[cfg(test)] mod tests { + use cli::Options; use super::Config; #[cfg(target_os="macos")] @@ -1733,6 +1743,26 @@ mod tests { // Sanity check that key bindings are being parsed assert!(!config.key_bindings.is_empty()); } + + #[test] + fn dynamic_title_ignoring_options_by_default() { + let config: Config = ::serde_yaml::from_str(ALACRITTY_YML) + .expect("deserialize config"); + let old_dynamic_title = config.dynamic_title; + let options = Options::default(); + let config = config.update_dynamic_title(&options); + assert_eq!(old_dynamic_title, config.dynamic_title); + } + + #[test] + fn dynamic_title_overridden_by_options() { + let config: Config = ::serde_yaml::from_str(ALACRITTY_YML) + .expect("deserialize config"); + let mut options = Options::default(); + options.title = Some("foo".to_owned()); + let config = config.update_dynamic_title(&options); + assert!(!config.dynamic_title); + } } #[cfg_attr(feature = "cargo-clippy", allow(enum_variant_names))] diff --git a/src/main.rs b/src/main.rs index b0e507e4..652569be 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,7 +44,7 @@ use alacritty::util::fmt::Red; fn main() { // Load command line options and config let options = cli::Options::load(); - let config = load_config(&options); + let config = load_config(&options).update_dynamic_title(&options); // Switch to home directory #[cfg(target_os = "macos")] @@ -178,7 +178,7 @@ fn run(mut config: Config, options: &cli::Options) -> Result<(), Box> { .as_ref() .and_then(|monitor| monitor.pending_config()) { - config = new_config; + config = new_config.update_dynamic_title(&options); display.update_config(&config); processor.update_config(&config); terminal.update_config(&config); diff --git a/src/window.rs b/src/window.rs index ef0d9269..1903360f 100644 --- a/src/window.rs +++ b/src/window.rs @@ -25,6 +25,23 @@ use MouseCursor; use cli::Options; use config::WindowConfig; +/// Default text for the window's title bar, if not overriden. +/// +/// In X11, this the default value for the `WM_NAME` property. +pub const DEFAULT_TITLE: &str = "Alacritty"; + +/// Default text for general window class, X11 specific. +/// +/// In X11, this is the default value for the `WM_CLASS` property. The +/// second value of `WM_CLASS` is **never** changed to anything but +/// the default value. +/// +/// ```ignore +/// $ xprop | grep WM_CLASS +/// WM_CLASS(STRING) = "Alacritty", "Alacritty" +/// ``` +pub const DEFAULT_CLASS: &str = "Alacritty"; + /// Window errors #[derive(Debug)] pub enum Error { @@ -205,12 +222,14 @@ impl Window { ) -> Result { let event_loop = EventsLoop::new(); + let title = options.title.as_ref().map_or(DEFAULT_TITLE, |t| t); + let class = options.class.as_ref().map_or(DEFAULT_CLASS, |c| c); let window_builder = WindowBuilder::new() - .with_title(&*options.title) + .with_title(title) .with_visibility(false) .with_transparency(true) .with_decorations(window_config.decorations()); - let window_builder = Window::platform_builder_ext(window_builder, &options.class); + let window_builder = Window::platform_builder_ext(window_builder, &class); let window = create_gl_window(window_builder.clone(), &event_loop, false) .or_else(|_| create_gl_window(window_builder, &event_loop, true))?; window.show(); From 128c25ee8b31473a6514e9bcaa59d8f9e66ea3a7 Mon Sep 17 00:00:00 2001 From: asoderman <5639572+asoderman@users.noreply.github.com> Date: Tue, 19 Jun 2018 17:27:47 -0400 Subject: [PATCH 07/32] Change green implementation to use the macro --- src/util.rs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/util.rs b/src/util.rs index f51a41f8..062e7651 100644 --- a/src/util.rs +++ b/src/util.rs @@ -74,24 +74,12 @@ pub mod fmt { /// Write a `Display` or `Debug` escaped with Red pub struct Red => "31"; + /// Write a `Display` or `Debug` escaped with Green + pub struct Green => "32"; + /// Write a `Display` or `Debug` escaped with Yellow pub struct Yellow => "33"; } - - /// Write a `Display` or `Debug` escaped with Red - pub struct Green(pub T); - - impl fmt::Display for Green { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "\x1b[32m{}\x1b[0m", self.0) - } - } - - impl fmt::Debug for Green { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "\x1b[32m{:?}\x1b[0m", self.0) - } - } } #[cfg(test)] From caf4580daa31c4c7249331b32826124d2b2b4143 Mon Sep 17 00:00:00 2001 From: Felippe da Motta Raposo Date: Sat, 23 Jun 2018 03:13:19 -0700 Subject: [PATCH 08/32] Ignore mouse input if window is unfocused --- src/event.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/event.rs b/src/event.rs index f592da5c..cff013e3 100644 --- a/src/event.rs +++ b/src/event.rs @@ -301,9 +301,11 @@ impl Processor { processor.received_char(c); }, MouseInput { state, button, modifiers, .. } => { - *hide_cursor = false; - processor.mouse_input(state, button, modifiers); - processor.ctx.terminal.dirty = true; + if *window_is_focused { + *hide_cursor = false; + processor.mouse_input(state, button, modifiers); + processor.ctx.terminal.dirty = true; + } }, CursorMoved { position: (x, y), modifiers, .. } => { let x = x as i32; From 015a6d4c03764608778d8aea80638fcc9704c2f3 Mon Sep 17 00:00:00 2001 From: Craig Furman Date: Tue, 26 Jun 2018 21:35:50 +0100 Subject: [PATCH 09/32] Make compilation of binary a phony target --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4f4ca807..dad41131 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ $(DMG_NAME): $(APP_NAME) install: $(DMG_NAME) ## Mount disk image @open $(DMG_DIR)/$(DMG_NAME) -.PHONY: app binary clean dmg install +.PHONY: app binary clean dmg install $(TARGET) clean: ## Remove all artifacts -rm -rf $(APP_DIR) From d5690f6cc75908d81d0eccf57e62d486c13d34f5 Mon Sep 17 00:00:00 2001 From: Avindra Goolcharan Date: Sun, 1 Jul 2018 10:22:57 -0400 Subject: [PATCH 10/32] Add opensuse zypper install method to readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index e761c64d..f783b3dc 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,12 @@ cd alacritty-git makepkg -isr ``` +### openSUSE Tumbleweed Linux + +```sh +zypper in alacritty +``` + ### Void Linux ```sh From 12afbd007db8a8995617b3e7ebda3840860bbadc Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sun, 1 Jul 2018 16:31:46 +0000 Subject: [PATCH 11/32] Fix clippy issues --- font/src/darwin/mod.rs | 6 +++--- font/src/ft/fc/mod.rs | 4 ++-- font/src/ft/mod.rs | 6 +++--- font/src/lib.rs | 2 +- src/ansi.rs | 8 ++++---- src/config.rs | 6 +++--- src/event.rs | 2 +- src/index.rs | 22 +++++++++++----------- src/input.rs | 28 ++++++++++++++-------------- src/renderer/mod.rs | 14 +++++++------- src/selection.rs | 8 ++++---- src/term/mod.rs | 22 +++++++++++----------- 12 files changed, 64 insertions(+), 64 deletions(-) diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs index 843d75dd..4351af61 100644 --- a/font/src/darwin/mod.rs +++ b/font/src/darwin/mod.rs @@ -162,7 +162,7 @@ impl ::Rasterize for Rasterizer { } /// Get rasterized glyph for given glyph key - fn get_glyph(&mut self, glyph: &GlyphKey) -> Result { + fn get_glyph(&mut self, glyph: GlyphKey) -> Result { // get loaded font let font = self.fonts @@ -246,7 +246,7 @@ impl Rasterizer { // Helper to try and get a glyph for a given font. Used for font fallback. fn maybe_get_glyph( &self, - glyph: &GlyphKey, + glyph: GlyphKey, font: &Font, ) -> Option> { let scaled_size = self.device_pixel_ratio * glyph.size.as_f32_pts(); @@ -356,7 +356,7 @@ impl Descriptor { let menlo = ct_new_from_descriptor(&descriptor.ct_descriptor, size); // TODO fixme, hardcoded en for english - let mut fallbacks = cascade_list_for_languages(&menlo, &vec!["en".to_owned()]) + let mut fallbacks = cascade_list_for_languages(&menlo, &["en".to_owned()]) .into_iter() .filter(|desc| desc.font_path != "") .map(|desc| desc.to_font(size, false)) diff --git a/font/src/ft/fc/mod.rs b/font/src/ft/fc/mod.rs index ac0c9442..865f63c9 100644 --- a/font/src/ft/fc/mod.rs +++ b/font/src/ft/fc/mod.rs @@ -180,9 +180,9 @@ pub enum Width { } impl Width { - fn to_isize(&self) -> isize { + fn to_isize(self) -> isize { use self::Width::*; - match *self { + match self { Ultracondensed => 50, Extracondensed => 63, Condensed => 75, diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs index 7c5fb768..cdae88cb 100644 --- a/font/src/ft/mod.rs +++ b/font/src/ft/mod.rs @@ -102,7 +102,7 @@ impl ::Rasterize for FreeTypeRasterizer { self.get_face(desc, size) } - fn get_glyph(&mut self, glyph_key: &GlyphKey) -> Result { + fn get_glyph(&mut self, glyph_key: GlyphKey) -> Result { self.get_rendered_glyph(glyph_key) } @@ -264,7 +264,7 @@ impl FreeTypeRasterizer { } } - fn face_for_glyph(&mut self, glyph_key: &GlyphKey, have_recursed: bool) -> Result { + fn face_for_glyph(&mut self, glyph_key: GlyphKey, have_recursed: bool) -> Result { let c = glyph_key.c; let use_initial_face = if self.faces.contains_key(&glyph_key.font_key) { @@ -285,7 +285,7 @@ impl FreeTypeRasterizer { } } - fn get_rendered_glyph(&mut self, glyph_key: &GlyphKey) + fn get_rendered_glyph(&mut self, glyph_key: GlyphKey) -> Result { // Render a custom symbol for the underline and beam cursor match glyph_key.c { diff --git a/font/src/lib.rs b/font/src/lib.rs index 05680da2..ad94d084 100644 --- a/font/src/lib.rs +++ b/font/src/lib.rs @@ -344,5 +344,5 @@ pub trait Rasterize { fn load_font(&mut self, &FontDesc, Size) -> Result; /// Rasterize the glyph described by `GlyphKey`. - fn get_glyph(&mut self, &GlyphKey) -> Result; + fn get_glyph(&mut self, GlyphKey) -> Result; } diff --git a/src/ansi.rs b/src/ansi.rs index dbc361a8..e37e25f1 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -561,8 +561,8 @@ pub enum NamedColor { } impl NamedColor { - pub fn to_bright(&self) -> Self { - match *self { + pub fn to_bright(self) -> Self { + match self { NamedColor::Black => NamedColor::BrightBlack, NamedColor::Red => NamedColor::BrightRed, NamedColor::Green => NamedColor::BrightGreen, @@ -583,8 +583,8 @@ impl NamedColor { } } - pub fn to_dim(&self) -> Self { - match *self { + pub fn to_dim(self) -> Self { + match self { NamedColor::Black => NamedColor::DimBlack, NamedColor::Red => NamedColor::DimRed, NamedColor::Green => NamedColor::DimGreen, diff --git a/src/config.rs b/src/config.rs index 539edb61..cdf1dc21 100644 --- a/src/config.rs +++ b/src/config.rs @@ -242,7 +242,7 @@ impl Alpha { } #[inline] - pub fn get(&self) -> f32 { + pub fn get(self) -> f32 { self.0 } @@ -1925,10 +1925,10 @@ enum Key { } impl Key { - fn to_glutin_key(&self) -> ::glutin::VirtualKeyCode { + fn to_glutin_key(self) -> ::glutin::VirtualKeyCode { use ::glutin::VirtualKeyCode::*; // Thank you, vim macros! - match *self { + match self { Key::Key1 => Key1, Key::Key2 => Key2, Key::Key3 => Key3, diff --git a/src/event.rs b/src/event.rs index cff013e3..c10f8a72 100644 --- a/src/event.rs +++ b/src/event.rs @@ -291,7 +291,7 @@ impl Processor { }, KeyboardInput { input, .. } => { let glutin::KeyboardInput { state, virtual_keycode, modifiers, .. } = input; - processor.process_key(state, virtual_keycode, &modifiers); + processor.process_key(state, virtual_keycode, modifiers); if state == ElementState::Pressed { // Hide cursor while typing *hide_cursor = true; diff --git a/src/index.rs b/src/index.rs index 418faff2..c5ae0794 100644 --- a/src/index.rs +++ b/src/index.rs @@ -270,7 +270,7 @@ macro_rules! inclusive { match *self { Empty { .. } => (0, Some(0)), - NonEmpty { ref start, ref end } => { + NonEmpty { start, end } => { let added = $steps_add_one(start, end); match added { Some(hint) => (hint.saturating_add(1), hint.checked_add(1)), @@ -283,9 +283,9 @@ macro_rules! inclusive { } } -fn steps_add_one_u8(start: &u8, end: &u8) -> Option { - if *start < *end { - Some((*end - *start) as usize) +fn steps_add_one_u8(start: u8, end: u8) -> Option { + if start < end { + Some((end - start) as usize) } else { None } @@ -330,11 +330,11 @@ macro_rules! ops { impl $ty { #[inline] #[allow(trivial_numeric_casts)] - fn steps_between(start: &$ty, end: &$ty, by: &$ty) -> Option { - if *by == $construct(0) { return None; } - if *start < *end { + fn steps_between(start: $ty, end: $ty, by: $ty) -> Option { + if by == $construct(0) { return None; } + if start < end { // Note: We assume $t <= usize here - let diff = (*end - *start).0; + let diff = (end - start).0; let by = by.0; if diff % by > 0 { Some(diff / by + 1) @@ -347,8 +347,8 @@ macro_rules! ops { } #[inline] - fn steps_between_by_one(start: &$ty, end: &$ty) -> Option { - Self::steps_between(start, end, &$construct(1)) + fn steps_between_by_one(start: $ty, end: $ty) -> Option { + Self::steps_between(start, end, $construct(1)) } } @@ -366,7 +366,7 @@ macro_rules! ops { } #[inline] fn size_hint(&self) -> (usize, Option) { - match Self::Item::steps_between_by_one(&self.0.start, &self.0.end) { + match Self::Item::steps_between_by_one(self.0.start, self.0.end) { Some(hint) => (hint, Some(hint)), None => (0, None) } diff --git a/src/input.rs b/src/input.rs index 7afd359d..aa00ee3d 100644 --- a/src/input.rs +++ b/src/input.rs @@ -102,15 +102,15 @@ impl Binding { fn is_triggered_by( &self, mode: TermMode, - mods: &ModifiersState, + mods: ModifiersState, input: &T ) -> bool { // Check input first since bindings are stored in one big list. This is // the most likely item to fail so prioritizing it here allows more // checks to be short circuited. self.trigger == *input && - self.mode_matches(&mode) && - self.not_mode_matches(&mode) && + self.mode_matches(mode) && + self.not_mode_matches(mode) && self.mods_match(mods) } } @@ -123,12 +123,12 @@ impl Binding { } #[inline] - fn mode_matches(&self, mode: &TermMode) -> bool { + fn mode_matches(&self, mode: TermMode) -> bool { self.mode.is_empty() || mode.intersects(self.mode) } #[inline] - fn not_mode_matches(&self, mode: &TermMode) -> bool { + fn not_mode_matches(&self, mode: TermMode) -> bool { self.notmode.is_empty() || !mode.intersects(self.notmode) } @@ -136,10 +136,10 @@ impl Binding { /// /// Optimized to use single check instead of four (one per modifier) #[inline] - fn mods_match(&self, mods: &ModifiersState) -> bool { + fn mods_match(&self, mods: ModifiersState) -> bool { debug_assert!(4 == mem::size_of::()); unsafe { - mem::transmute_copy::<_, u32>(&self.mods) == mem::transmute_copy::<_, u32>(mods) + mem::transmute_copy::<_, u32>(&self.mods) == mem::transmute_copy::<_, u32>(&mods) } } } @@ -532,7 +532,7 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { return; } - self.process_mouse_bindings(&ModifiersState::default(), button); + self.process_mouse_bindings(ModifiersState::default(), button); } /// Process key input @@ -542,11 +542,11 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { &mut self, state: ElementState, key: Option, - mods: &ModifiersState, + mods: ModifiersState, ) { match (key, state) { (Some(key), ElementState::Pressed) => { - *self.ctx.last_modifiers() = *mods; + *self.ctx.last_modifiers() = mods; *self.ctx.received_count() = 0; *self.ctx.suppress_chars() = false; @@ -587,7 +587,7 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { /// for its action to be executed. /// /// Returns true if an action is executed. - fn process_key_bindings(&mut self, mods: &ModifiersState, key: VirtualKeyCode) -> bool { + fn process_key_bindings(&mut self, mods: ModifiersState, key: VirtualKeyCode) -> bool { for binding in self.key_bindings { if binding.is_triggered_by(self.ctx.terminal_mode(), mods, &key) { // binding was triggered; run the action @@ -605,7 +605,7 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { /// for its action to be executed. /// /// Returns true if an action is executed. - fn process_mouse_bindings(&mut self, mods: &ModifiersState, button: MouseButton) -> bool { + fn process_mouse_bindings(&mut self, mods: ModifiersState, button: MouseButton) -> bool { for binding in self.mouse_bindings { if binding.is_triggered_by(self.ctx.terminal_mode(), mods, &button) { // binding was triggered; run the action @@ -782,9 +782,9 @@ mod tests { #[test] fn $name() { if $triggers { - assert!($binding.is_triggered_by($mode, &$mods, &KEY)); + assert!($binding.is_triggered_by($mode, $mods, &KEY)); } else { - assert!(!$binding.is_triggered_by($mode, &$mods, &KEY)); + assert!(!$binding.is_triggered_by($mode, $mods, &KEY)); } } } diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index 0d474123..b006f566 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -183,7 +183,7 @@ impl GlyphCache { // Need to load at least one glyph for the face before calling metrics. // The glyph requested here ('m' at the time of writing) has no special // meaning. - rasterizer.get_glyph(&GlyphKey { font_key: regular, c: 'm', size: font.size() })?; + rasterizer.get_glyph(GlyphKey { font_key: regular, c: 'm', size: font.size() })?; let metrics = rasterizer.metrics(regular)?; let mut cache = GlyphCache { @@ -211,7 +211,7 @@ impl GlyphCache { ) { let size = self.font_size; for i in RangeInclusive::new(32u8, 128u8) { - self.get(&GlyphKey { + self.get(GlyphKey { font_key: font, c: i as char, size, @@ -273,14 +273,14 @@ impl GlyphCache { .expect("metrics load since font is loaded at glyph cache creation") } - pub fn get<'a, L>(&'a mut self, glyph_key: &GlyphKey, loader: &mut L) -> &'a Glyph + pub fn get<'a, L>(&'a mut self, glyph_key: GlyphKey, loader: &mut L) -> &'a Glyph where L: LoadGlyph { let glyph_offset = self.glyph_offset; let rasterizer = &mut self.rasterizer; let metrics = &self.metrics; self.cache - .entry(*glyph_key) + .entry(glyph_key) .or_insert_with(|| { let mut rasterized = rasterizer.get_glyph(glyph_key) .unwrap_or_else(|_| Default::default()); @@ -306,7 +306,7 @@ impl GlyphCache { let font = font.to_owned().with_size(size); info!("Font size changed: {:?}", font.size); let (regular, bold, italic) = Self::compute_font_keys(&font, &mut self.rasterizer)?; - self.rasterizer.get_glyph(&GlyphKey { font_key: regular, c: 'm', size: font.size() })?; + self.rasterizer.get_glyph(GlyphKey { font_key: regular, c: 'm', size: font.size() })?; let metrics = self.rasterizer.metrics(regular)?; self.font_size = font.size; @@ -842,7 +842,7 @@ impl<'a> RenderApi<'a> { // Add cell to batch { - let glyph = glyph_cache.get(&glyph_key, self); + let glyph = glyph_cache.get(glyph_key, self); self.add_render_item(&cell, glyph); } @@ -856,7 +856,7 @@ impl<'a> RenderApi<'a> { c: '_' }; - let underscore = glyph_cache.get(&glyph_key, self); + let underscore = glyph_cache.get(glyph_key, self); self.add_render_item(&cell, underscore); } } diff --git a/src/selection.rs b/src/selection.rs index cd905164..ae584025 100644 --- a/src/selection.rs +++ b/src/selection.rs @@ -152,7 +152,7 @@ impl Selection { Selection::Semantic { ref region, ref initial_expansion } => { Selection::span_semantic(grid, region, initial_expansion) }, - Selection::Lines { ref region, ref initial_line } => { + Selection::Lines { ref region, initial_line } => { Selection::span_lines(grid, region, initial_line) } } @@ -192,18 +192,18 @@ impl Selection { }) } - fn span_lines(grid: &G, region: &Region, initial_line: &Line) -> Option + fn span_lines(grid: &G, region: &Region, initial_line: Line) -> Option where G: Dimensions { // First, create start and end points based on initial line and the grid // dimensions. let mut start = Point { col: Column(0), - line: *initial_line + line: initial_line }; let mut end = Point { col: grid.dimensions().col - 1, - line: *initial_line + line: initial_line }; // Now, expand lines based on where cursor started and ended. diff --git a/src/term/mod.rs b/src/term/mod.rs index 27cc9312..d1f48c91 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -269,9 +269,9 @@ impl<'a> RenderableCellsIter<'a> { self.mode.contains(mode::TermMode::SHOW_CURSOR) && self.grid.contains(self.cursor) } - fn compute_fg_rgb(&self, fg: &Color, cell: &Cell) -> Rgb { + fn compute_fg_rgb(&self, fg: Color, cell: &Cell) -> Rgb { use self::cell::Flags; - match *fg { + match fg { Color::Spec(rgb) => rgb, Color::Named(ansi) => { match (self.config.draw_bold_text_with_bright_colors(), cell.flags & Flags::DIM_BOLD) { @@ -302,15 +302,15 @@ impl<'a> RenderableCellsIter<'a> { } #[inline] - fn compute_bg_alpha(&self, bg: &Color) -> f32 { - match *bg { + fn compute_bg_alpha(&self, bg: Color) -> f32 { + match bg { Color::Named(NamedColor::Background) => 0.0, _ => 1.0 } } - fn compute_bg_rgb(&self, bg: &Color) -> Rgb { - match *bg { + fn compute_bg_rgb(&self, bg: Color) -> Rgb { + match bg { Color::Spec(rgb) => rgb, Color::Named(ansi) => self.colors[ansi], Color::Indexed(idx) => self.colors[idx], @@ -387,13 +387,13 @@ impl<'a> Iterator for RenderableCellsIter<'a> { fg_rgb = self.colors[NamedColor::Background]; bg_alpha = 1.0 } else { - bg_rgb = self.compute_fg_rgb(&cell.fg, &cell); - fg_rgb = self.compute_bg_rgb(&cell.bg); + bg_rgb = self.compute_fg_rgb(cell.fg, &cell); + fg_rgb = self.compute_bg_rgb(cell.bg); } } else { - fg_rgb = self.compute_fg_rgb(&cell.fg, &cell); - bg_rgb = self.compute_bg_rgb(&cell.bg); - bg_alpha = self.compute_bg_alpha(&cell.bg); + fg_rgb = self.compute_fg_rgb(cell.fg, &cell); + bg_rgb = self.compute_bg_rgb(cell.bg); + bg_alpha = self.compute_bg_alpha(cell.bg); } return Some(RenderableCell { From 12f952df42941be8a94a90f9a029e041c9281142 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sun, 1 Jul 2018 16:36:15 +0000 Subject: [PATCH 12/32] Update manpage to document all CLI options The introduction of `--class` has added a flag to the CLI without adding it to the manpage. This has been fixed by updating the manpage. This also adds the default values of `--class` and `--title` to the CLI options. --- alacritty.man | 3 +++ src/cli.rs | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/alacritty.man b/alacritty.man index 31e2934e..31ea2ba9 100644 --- a/alacritty.man +++ b/alacritty.man @@ -36,6 +36,9 @@ Increases the level of verbosity (the max level is \fB\-vvv\fR) Prints version information .SH "OPTIONS" .TP +\fB\-\-class\fR +Defines the window class on X11 [default: Alacritty] +.TP \fB\-e\fR, \fB\-\-command\fR ... Command and args to execute (must be last argument) .HP diff --git a/src/cli.rs b/src/cli.rs index 92b83f6c..0a36179a 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -15,6 +15,7 @@ extern crate log; use clap::{Arg, App}; use index::{Line, Column}; use config::{Dimensions, Shell}; +use window::{DEFAULT_TITLE, DEFAULT_CLASS}; use std::path::{Path, PathBuf}; use std::borrow::Cow; @@ -80,11 +81,11 @@ impl Options { .long("title") .short("t") .takes_value(true) - .help("Defines the window title")) + .help(&format!("Defines the window title [default: {}]", DEFAULT_TITLE))) .arg(Arg::with_name("class") .long("class") .takes_value(true) - .help("Defines window class on X11")) + .help(&format!("Defines window class on X11 [default: {}]", DEFAULT_CLASS))) .arg(Arg::with_name("q") .short("q") .multiple(true) From 985ba306c78857e07f3f267ab954ad069d30a465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sun, 1 Jul 2018 22:20:29 +0200 Subject: [PATCH 13/32] Remove unnecessary clippy lint annotations We moved to "cargo clippy" in 5ba34d4f9766a55a06ed5e3e44cc384af1b09f65 and removing the clippy lint annotations in `src/lib.rs` does not cause any additional warnings. This also changes `cargo clippy` to use the flags required for checking integration tests. --- .travis.yml | 2 +- src/lib.rs | 3 --- src/util.rs | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2b6192d7..2dd8a4f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,5 +29,5 @@ matrix: - rust: nightly script: - - if [ -n "$CLIPPY" ]; then cargo clippy; fi + - if [ -n "$CLIPPY" ]; then cargo clippy --all-features --all-targets; fi - if [ -z "$CLIPPY" ]; then cargo test; fi diff --git a/src/lib.rs b/src/lib.rs index afbd8595..d6229ee7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -110,9 +110,6 @@ impl Mul for Rgb { } -#[cfg_attr(feature = "clippy", allow(too_many_arguments))] -#[cfg_attr(feature = "clippy", allow(doc_markdown))] -#[cfg_attr(feature = "clippy", allow(unreadable_literal))] #[allow(unused_mut)] pub mod gl { #![allow(non_upper_case_globals)] diff --git a/src/util.rs b/src/util.rs index 062e7651..6065e01b 100644 --- a/src/util.rs +++ b/src/util.rs @@ -15,7 +15,6 @@ use std::cmp; #[cfg(not(feature = "nightly"))] #[inline(always)] -#[cfg_attr(feature = "clippy", allow(inline_always))] pub unsafe fn unlikely(x: bool) -> bool { x } From 21eb50aa50586ae95d553ae097cb1199334ac1c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Tue, 3 Jul 2018 00:11:24 +0200 Subject: [PATCH 14/32] Enable clippy in font/copypasta crates Enabled clippy in the sub-crates font and copypasta. All issues that were discovered by this change have also been fixed. --- copypasta/src/lib.rs | 2 ++ font/src/ft/mod.rs | 6 +++--- font/src/lib.rs | 3 +++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/copypasta/src/lib.rs b/copypasta/src/lib.rs index 2857ce82..f0b3c53e 100644 --- a/copypasta/src/lib.rs +++ b/copypasta/src/lib.rs @@ -1,5 +1,7 @@ //! A cross-platform clipboard library +#![cfg_attr(feature = "cargo-clippy", deny(clippy, if_not_else, enum_glob_use, wrong_pub_self_convention))] + // This has to be here due to macro_use #[cfg(target_os = "macos")] #[macro_use] extern crate objc; diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs index cdae88cb..516f3b9c 100644 --- a/font/src/ft/mod.rs +++ b/font/src/ft/mod.rs @@ -232,15 +232,15 @@ impl FreeTypeRasterizer { let ft_face = self.library.new_face(&path, index)?; // Get available pixel sizes if font isn't scalable. - let non_scalable = if !pattern.scalable().next().unwrap_or(true) { + let non_scalable = if pattern.scalable().next().unwrap_or(true) { + None + } else { let mut pixelsize = pattern.pixelsize(); debug!("pixelsizes: {:?}", pixelsize); Some(FixedSize { pixelsize: pixelsize.next().expect("has 1+ pixelsize"), }) - } else { - None }; let face = Face { diff --git a/font/src/lib.rs b/font/src/lib.rs index ad94d084..fe9e9e85 100644 --- a/font/src/lib.rs +++ b/font/src/lib.rs @@ -17,6 +17,9 @@ //! CoreText is used on Mac OS. //! FreeType is used on everything that's not Mac OS. //! Eventually, ClearType support will be available for windows + +#![cfg_attr(feature = "cargo-clippy", deny(clippy, if_not_else, enum_glob_use, wrong_pub_self_convention))] + #[cfg(not(target_os = "macos"))] extern crate fontconfig; #[cfg(not(target_os = "macos"))] From 68b3d8abfdeeb388edb1b5e0528d3fddb66fd9e8 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Tue, 3 Jul 2018 12:35:13 -0400 Subject: [PATCH 15/32] Remove outdated comment about NixOS --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index f783b3dc..e0a23b20 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,7 @@ built from source. Instructions are provided for macOS and many Linux variants to compile Alacritty from source. With the exception of Arch (which has a package in the AUR), Void Linux (in main repository) and -[NixOS](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/alacritty/default.nix) -(at the moment in unstable, will be part of 17.09), please first read the +[NixOS](https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/misc/alacritty/default.nix), please first read the [prerequisites](#prerequisites) section, then find the section for your OS, and finally go to [building](#building) and [configuration](#configuration). From 7433f45ff9c6efeb48e223e90dd4aa9ee135b5e8 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 5 Jul 2018 23:05:33 +0000 Subject: [PATCH 16/32] Replace debug asserts with static_assertions To check that transmutes will work correctly without having to rely on error-prone runtime checking, the `static_assertions` crate has been introduced. This allows comparing the size of types at compile time, preventing potentially silent breakage. This fixes #1417. --- Cargo.lock | 7 +++++++ Cargo.toml | 1 + src/input.rs | 2 +- src/lib.rs | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index da529458..95a09602 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,6 +33,7 @@ dependencies = [ "serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", + "static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "vte 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "x11-dl 2.18.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -966,6 +967,11 @@ name = "stable_deref_trait" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "static_assertions" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "strsim" version = "0.7.0" @@ -1361,6 +1367,7 @@ dependencies = [ "checksum smallvec 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "03dab98ab5ded3a8b43b2c80751194608d0b2aa0f1d46cf95d1c35e192844aa7" "checksum smithay-client-toolkit 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "84c45607482d31161951f4ea11ba2673e3999e1cc6ca2d50a72eaee7eae3cbf1" "checksum stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ffbc596e092fe5f598b12ef46cc03754085ac2f4d8c739ad61c4ae266cc3b3fa" +"checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum syn 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c67da57e61ebc7b7b6fff56bb34440ca3a83db037320b0507af4c10368deda7d" "checksum tempfile 3.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47776f63b85777d984a50ce49d6b9e58826b6a3766a449fc95bc66cd5663c15b" diff --git a/Cargo.toml b/Cargo.toml index a316f4d7..7e542dc4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,7 @@ arraydeque = "0.4" glutin = "0.16" env_logger = "0.5" base64 = "0.9.0" +static_assertions = "0.2.5" [target.'cfg(any(target_os = "linux", target_os = "freebsd", target_os="dragonfly", target_os="openbsd"))'.dependencies] x11-dl = "2" diff --git a/src/input.rs b/src/input.rs index aa00ee3d..701feea1 100644 --- a/src/input.rs +++ b/src/input.rs @@ -137,7 +137,7 @@ impl Binding { /// Optimized to use single check instead of four (one per modifier) #[inline] fn mods_match(&self, mods: ModifiersState) -> bool { - debug_assert!(4 == mem::size_of::()); + assert_eq_size!(ModifiersState, u32); unsafe { mem::transmute_copy::<_, u32>(&self.mods) == mem::transmute_copy::<_, u32>(&mods) } diff --git a/src/lib.rs b/src/lib.rs index d6229ee7..d9006fe0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -21,6 +21,7 @@ #[macro_use] extern crate clap; #[macro_use] extern crate log; #[macro_use] extern crate serde_derive; +#[macro_use] extern crate static_assertions; #[cfg(any(target_os = "linux", target_os = "freebsd", target_os="dragonfly", target_os="openbsd"))] extern crate x11_dl; From 4928b0ae75aa326e8dd96e745fb701ae1ce1fce1 Mon Sep 17 00:00:00 2001 From: Micha Gorelick Date: Sun, 15 Jul 2018 09:00:58 -0400 Subject: [PATCH 17/32] Add `cargo deb` build instructions Updated the `Cargo.toml` file and added a `package.metadata.deb` subsection to define how to build a debian "deb" install file using `cargo deb`. This will allow debian/ubuntu users to install `alacritty` using their system's package manager. It also will make it easier to provide pre-built binaries for those systems. Also fixed a stray debug line in the bash autocomplete script that was writting to a tempfile. --- Cargo.toml | 22 ++++++++++++++++++++++ README.md | 23 +++++++++++++++++++---- alacritty-completions.bash | 1 - 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7e542dc4..41b67c8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,8 @@ authors = ["Joe Wilm "] license = "Apache-2.0" build = "build.rs" description = "GPU-accelerated terminal emulator" +readme = "README.md" +homepage = "https://github.com/jwilm/alacritty" [[bin]] doc = false @@ -57,3 +59,23 @@ gl_generator = "0.9" [profile.release] lto = true debug = 1 + +[package.metadata.deb] +maintainer = "Joe Wilm " +license-file = ["LICENSE-APACHE", "3"] +extended-description = """\ +Alacritty is the fastest terminal emulator in existence. Using the GPU for \ +rendering enables optimizations that simply aren't possible in other emulators. \ +Alacritty currently supports FreeBSD, Linux, macOS, and OpenBSD. Windows \ +support is planned before the 1.0 release. """ +depends = "$auto, cmake, libfreetype6-dev, libfontconfig1-dev, xclip, gperf" +section = "rust" +priority = "optional" +assets = [ + ["target/release/alacritty", "usr/local/bin/", "755"], + ["Alacritty.desktop", "usr/share/applications/", "644"], + ["alacritty-completions.bash", "usr/share/bash-completion/completions/alacritty", "644"], + ["alacritty-completions.fish", "usr/share/fish/completions/alacritty", "644"], + ["alacritty-completions.zsh", "usr/share/zsh/functions/Completion/alacritty", "644"], + ["alacritty.info", "usr/share/terminfo/a/alacritty", "644"], +] diff --git a/README.md b/README.md index e0a23b20..aaf699a2 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,17 @@ cd alacritty-git makepkg -isr ``` +### Debian/Ubuntu + +Using `cargo deb`, you can create and install a deb file. + +```sh +git clone git@github.com:jwilm/alacritty.git +cd alacritty +cargo install cargo-deb +cargo deb --install +``` + ### openSUSE Tumbleweed Linux ```sh @@ -86,11 +97,14 @@ xbps-install alacritty rustup update stable ``` -#### Ubuntu +#### Debian/Ubuntu -On Ubuntu, you need a few extra libraries to build Alacritty. Here's an `apt` -command that should install all of them. If something is still found to be -missing, please open an issue. +You can build alacritty using `cargo deb` and use your system's package manager +to maintain the application using the instructions [above](#debianubuntu). + +If you'd still like to build a local version manually, you need a few extra +libraries to build Alacritty. Here's an apt command that should install all of +them. If something is still found to be missing, please open an issue. ```sh apt-get install cmake libfreetype6-dev libfontconfig1-dev xclip @@ -244,6 +258,7 @@ cargo build --release If all goes well, this should place a binary at `target/release/alacritty`. + ##### Desktop Entry Many linux distributions support desktop entries for adding applications to diff --git a/alacritty-completions.bash b/alacritty-completions.bash index 57191515..f8ffc107 100644 --- a/alacritty-completions.bash +++ b/alacritty-completions.bash @@ -15,7 +15,6 @@ _alacritty() # If `--command` or `-e` is used, stop completing for i in "${!COMP_WORDS[@]}"; do - echo "${COMP_WORDS[i]}" >> ./testfile if [[ "${COMP_WORDS[i]}" == "--command" ]] \ || [[ "${COMP_WORDS[i]}" == "-e" ]] \ && [[ "${#COMP_WORDS[@]}" -gt "$(($i + 2))" ]] From 18f6a7814a7aff8fb06d6b9a795e0f8144954d1f Mon Sep 17 00:00:00 2001 From: Patrycja Balik Date: Sun, 15 Jul 2018 15:10:33 +0200 Subject: [PATCH 18/32] Add config for unfocused window cursor change --- alacritty.yml | 3 +++ alacritty_macos.yml | 3 +++ src/config.rs | 10 ++++++++++ src/term/mod.rs | 2 +- 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/alacritty.yml b/alacritty.yml index 1b59434f..fcbe1d02 100644 --- a/alacritty.yml +++ b/alacritty.yml @@ -237,6 +237,9 @@ hide_cursor_when_typing: false # - Beam cursor_style: Block +# Whether the cursor should be a hollow block on window focus loss +unfocused_hollow_cursor: true + # Live config reload (changes require restart) live_config_reload: true diff --git a/alacritty_macos.yml b/alacritty_macos.yml index 19590842..4469c190 100644 --- a/alacritty_macos.yml +++ b/alacritty_macos.yml @@ -216,6 +216,9 @@ hide_cursor_when_typing: false # - Beam cursor_style: Block +# Whether the cursor should be a hollow block on window focus loss +unfocused_hollow_cursor: true + # Live config reload (changes require restart) live_config_reload: true diff --git a/src/config.rs b/src/config.rs index cdf1dc21..95058d38 100644 --- a/src/config.rs +++ b/src/config.rs @@ -390,6 +390,10 @@ pub struct Config { #[serde(default, deserialize_with = "failure_default")] cursor_style: CursorStyle, + /// Use hollow block cursor when unfocused + #[serde(default="true_bool", deserialize_with = "default_true_bool")] + unfocused_hollow_cursor: bool, + /// Live config reload #[serde(default="true_bool", deserialize_with = "default_true_bool")] live_config_reload: bool, @@ -1363,6 +1367,12 @@ impl Config { self.cursor_style } + /// Use hollow block cursor when unfocused + #[inline] + pub fn unfocused_hollow_cursor(&self) -> bool { + self.unfocused_hollow_cursor + } + /// Live config reload #[inline] pub fn live_config_reload(&self) -> bool { diff --git a/src/term/mod.rs b/src/term/mod.rs index d1f48c91..02d846a4 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -998,7 +998,7 @@ impl Term { ) -> RenderableCellsIter { let selection = selection.and_then(|s| s.to_span(self)) .map(|span| span.to_range()); - let cursor = if window_focused { + let cursor = if window_focused || !config.unfocused_hollow_cursor() { self.cursor_style.unwrap_or(self.default_cursor_style) } else { CursorStyle::HollowBlock From 4ae2bc66f2bd213511997addfed8b589fdc97406 Mon Sep 17 00:00:00 2001 From: Anthony Clays Date: Sun, 15 Jul 2018 18:02:44 +0200 Subject: [PATCH 19/32] Add support for cursor shape escape sequence --- src/ansi.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/ansi.rs b/src/ansi.rs index e37e25f1..3fbd580d 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -814,6 +814,21 @@ impl<'a, H, W> vte::Perform for Performer<'a, H, W> unhandled(params); } + // Set cursor style + b"50" => { + if params.len() >= 2 && params[1].len() >= 13 && params[1][0..12] == *b"CursorShape=" { + let style = match params[1][12] as char { + '0' => CursorStyle::Block, + '1' => CursorStyle::Beam, + '2' => CursorStyle::Underline, + _ => return unhandled(params), + }; + self.handler.set_cursor_style(Some(style)); + return; + } + unhandled(params); + } + // Set clipboard b"52" => { if params.len() < 3 { From 96b3d737a8ee1805ec548671a6ba8f219b2c2934 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sun, 15 Jul 2018 19:47:07 +0000 Subject: [PATCH 20/32] Add bright foreground color option It was requested in jwilm/alacritty#825 that it should be possible to add an optional bright foreground color. This is now added to the primary colors structure and allows the user to set a foreground color for bold normal text. This has no effect unless the draw_bold_text_with_bright_colors option is also enabled. If the color is not specified, the bright foreground color will fall back to the normal foreground color. This fixes #825. --- alacritty.yml | 1 + alacritty_macos.yml | 1 + src/ansi.rs | 3 +++ src/config.rs | 19 +++++++++++++++++++ src/term/color.rs | 7 ++++++- 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/alacritty.yml b/alacritty.yml index fcbe1d02..8cee1d48 100644 --- a/alacritty.yml +++ b/alacritty.yml @@ -117,6 +117,7 @@ colors: primary: background: '0x000000' foreground: '0xeaeaea' + bright_foreground: '0xeaeaea' # Colors the cursor will use if `custom_cursor_colors` is true cursor: diff --git a/alacritty_macos.yml b/alacritty_macos.yml index 4469c190..3566422b 100644 --- a/alacritty_macos.yml +++ b/alacritty_macos.yml @@ -95,6 +95,7 @@ colors: primary: background: '0x000000' foreground: '0xeaeaea' + bright_foreground: '0xeaeaea' # Colors the cursor will use if `custom_cursor_colors` is true cursor: diff --git a/src/ansi.rs b/src/ansi.rs index 3fbd580d..726550a0 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -558,11 +558,14 @@ pub enum NamedColor { DimCyan, /// Dim white DimWhite, + /// The bright foreground color + BrightForeground, } impl NamedColor { pub fn to_bright(self) -> Self { match self { + NamedColor::Foreground => NamedColor::BrightForeground, NamedColor::Black => NamedColor::BrightBlack, NamedColor::Red => NamedColor::BrightRed, NamedColor::Green => NamedColor::BrightGreen, diff --git a/src/config.rs b/src/config.rs index 95058d38..8d63a9c0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1022,6 +1022,24 @@ pub struct PrimaryColors { pub background: Rgb, #[serde(deserialize_with = "rgb_from_hex")] pub foreground: Rgb, + #[serde(default, deserialize_with = "deserialize_bright_foreground")] + pub bright_foreground: Option, +} + +fn deserialize_bright_foreground<'a, D>(deserializer: D) -> ::std::result::Result, D::Error> + where D: de::Deserializer<'a> +{ + match Option::deserialize(deserializer) { + Ok(Some(color)) => { + let color: serde_yaml::Value = color; + Ok(Some(rgb_from_hex(color).unwrap())) + }, + Ok(None) => Ok(None), + Err(err) => { + eprintln!("problem with config: {}; Using standard foreground color", err); + Ok(None) + }, + } } impl Default for PrimaryColors { @@ -1029,6 +1047,7 @@ impl Default for PrimaryColors { PrimaryColors { background: Rgb { r: 0, g: 0, b: 0 }, foreground: Rgb { r: 0xea, g: 0xea, b: 0xea }, + bright_foreground: None, } } } diff --git a/src/term/color.rs b/src/term/color.rs index d25f2f3d..b84f11bd 100644 --- a/src/term/color.rs +++ b/src/term/color.rs @@ -4,7 +4,7 @@ use std::fmt; use {Rgb, ansi}; use config::Colors; -pub const COUNT: usize = 268; +pub const COUNT: usize = 269; /// List of indexed colors /// @@ -13,6 +13,7 @@ pub const COUNT: usize = 268; /// the configured foreground color, item 257 is the configured background /// color, item 258 is the cursor foreground color, item 259 is the cursor /// background color. Following that are 8 positions for dim colors. +/// Item 268 is the bright foreground color. #[derive(Copy, Clone)] pub struct List([Rgb; COUNT]); @@ -50,6 +51,10 @@ impl List { self[ansi::NamedColor::BrightMagenta] = colors.bright.magenta; self[ansi::NamedColor::BrightCyan] = colors.bright.cyan; self[ansi::NamedColor::BrightWhite] = colors.bright.white; + self[ansi::NamedColor::BrightForeground] = colors + .primary + .bright_foreground + .unwrap_or(colors.primary.foreground); // Foreground and background self[ansi::NamedColor::Foreground] = colors.primary.foreground; From 7cc9c11bc9d07c21465b2ae68af1a5e36d640884 Mon Sep 17 00:00:00 2001 From: zaript Date: Mon, 16 Jul 2018 17:39:49 +0100 Subject: [PATCH 21/32] Fix clone URL in deb install instructions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aaf699a2..3afabc8f 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ makepkg -isr Using `cargo deb`, you can create and install a deb file. ```sh -git clone git@github.com:jwilm/alacritty.git +git clone https://github.com/jwilm/alacritty.git cd alacritty cargo install cargo-deb cargo deb --install From 3dabb9783e13580ba283942d632c5469eca8956a Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Wed, 18 Jul 2018 18:39:48 +0000 Subject: [PATCH 22/32] Fix 'cargo-deb' desktop file name --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 41b67c8f..eb8bde8d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,7 +73,7 @@ section = "rust" priority = "optional" assets = [ ["target/release/alacritty", "usr/local/bin/", "755"], - ["Alacritty.desktop", "usr/share/applications/", "644"], + ["alacritty.desktop", "usr/share/applications/", "644"], ["alacritty-completions.bash", "usr/share/bash-completion/completions/alacritty", "644"], ["alacritty-completions.fish", "usr/share/fish/completions/alacritty", "644"], ["alacritty-completions.zsh", "usr/share/zsh/functions/Completion/alacritty", "644"], From 512fc6109182523c50e55ca8729b056442f36823 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Thu, 19 Jul 2018 16:47:53 +0000 Subject: [PATCH 23/32] Remove redundant dependency from deb build --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index eb8bde8d..d196e8c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,7 +68,7 @@ Alacritty is the fastest terminal emulator in existence. Using the GPU for \ rendering enables optimizations that simply aren't possible in other emulators. \ Alacritty currently supports FreeBSD, Linux, macOS, and OpenBSD. Windows \ support is planned before the 1.0 release. """ -depends = "$auto, cmake, libfreetype6-dev, libfontconfig1-dev, xclip, gperf" +depends = "$auto, cmake, libfreetype6-dev, libfontconfig1-dev, xclip" section = "rust" priority = "optional" assets = [ From 5153c20ace96ea12f0a2714dc33d777c16ac2808 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Fri, 20 Jul 2018 18:03:37 +0000 Subject: [PATCH 24/32] Switch from deprecated `std::env::home_dir` to `dirs::home_dir` --- Cargo.lock | 11 +++++++++++ Cargo.toml | 1 + src/main.rs | 4 +++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 95a09602..6f11c4b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16,6 +16,7 @@ dependencies = [ "cgmath 0.16.1 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)", "copypasta 0.0.1", + "dirs 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "errno 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -253,6 +254,15 @@ dependencies = [ "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "dirs" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "dlib" version = "0.4.1" @@ -1285,6 +1295,7 @@ dependencies = [ "checksum core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb0ed45fdc32f9ab426238fba9407dfead7bacd7900c9b4dd3f396f46eafdae3" "checksum core-graphics 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e54c4ab33705fa1fc8af375bb7929d68e1c1546c1ecef408966d8c3e49a1d84a" "checksum core-text 9.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2bd581c37283d0c23311d179aefbb891f2324ee0405da58a26e8594ab76e5748" +"checksum dirs 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "37a76dd8b997af7107d0bb69d43903cf37153a18266f8b3fdb9911f28efb5444" "checksum dlib 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "77e51249a9d823a4cb79e3eca6dcd756153e8ed0157b6c04775d04bf1b13b76a" "checksum downcast-rs 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "18df8ce4470c189d18aa926022da57544f31e154631eb4cfe796aea97051fe6c" "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" diff --git a/Cargo.toml b/Cargo.toml index d196e8c1..df237669 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,6 +45,7 @@ x11-dl = "2" [target.'cfg(target_os = "macos")'.dependencies] objc = "0.2.2" +dirs = "1.0.2" [features] default = [] diff --git a/src/main.rs b/src/main.rs index 652569be..f7a1fa1a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,6 +22,8 @@ extern crate alacritty; #[macro_use] extern crate log; +#[cfg(target_os = "macos")] +extern crate dirs; use std::error::Error; use std::sync::Arc; @@ -48,7 +50,7 @@ fn main() { // Switch to home directory #[cfg(target_os = "macos")] - env::set_current_dir(env::home_dir().unwrap()).unwrap(); + env::set_current_dir(dirs::home_dir().unwrap()).unwrap(); // Set locale #[cfg(target_os = "macos")] locale::set_locale_environment(); From 48c0a7b067a48a77e0b925dc0e75b04422e04a92 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sat, 21 Jul 2018 17:37:13 +0000 Subject: [PATCH 25/32] Allow specifying modifiers for mouse bindings --- src/input.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/input.rs b/src/input.rs index 701feea1..bc33094a 100644 --- a/src/input.rs +++ b/src/input.rs @@ -532,7 +532,7 @@ impl<'a, A: ActionContext + 'a> Processor<'a, A> { return; } - self.process_mouse_bindings(ModifiersState::default(), button); + self.process_mouse_bindings(modifiers, button); } /// Process key input From a6e8974a06138c6ce1c71f8a80f7f013a9ad9463 Mon Sep 17 00:00:00 2001 From: Aleksandr Pasechnik Date: Sat, 21 Jul 2018 13:41:39 -0400 Subject: [PATCH 26/32] Send newline with NumpadEnter --- alacritty_macos.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/alacritty_macos.yml b/alacritty_macos.yml index 3566422b..4bd9c026 100644 --- a/alacritty_macos.yml +++ b/alacritty_macos.yml @@ -373,3 +373,4 @@ key_bindings: - { key: F10, mods: Command, chars: "\x1b[21;3~" } - { key: F11, mods: Command, chars: "\x1b[23;3~" } - { key: F12, mods: Command, chars: "\x1b[24;3~" } + - { key: NumpadEnter, chars: "\n" } From 0d5edb7a7a7a33369bc2c1e5cc007edbd6fcf15f Mon Sep 17 00:00:00 2001 From: yshui Date: Sat, 21 Jul 2018 18:05:14 +0000 Subject: [PATCH 27/32] Add support for LCD-V pixel mode --- font/src/ft/mod.rs | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs index 516f3b9c..9ace5b0c 100644 --- a/font/src/ft/mod.rs +++ b/font/src/ft/mod.rs @@ -348,14 +348,14 @@ impl FreeTypeRasterizer { let glyph = face.ft_face.glyph(); glyph.render_glyph(face.render_mode)?; - let (pixel_width, buf) = Self::normalize_buffer(&glyph.bitmap())?; + let (pixel_height, pixel_width, buf) = Self::normalize_buffer(&glyph.bitmap())?; Ok(RasterizedGlyph { c: glyph_key.c, top: glyph.bitmap_top(), left: glyph.bitmap_left(), width: pixel_width, - height: glyph.bitmap().rows(), + height: pixel_height, buf, }) } @@ -427,7 +427,7 @@ impl FreeTypeRasterizer { /// Given a FreeType `Bitmap`, returns packed buffer with 1 byte per LCD channel. /// /// The i32 value in the return type is the number of pixels per row. - fn normalize_buffer(bitmap: &freetype::bitmap::Bitmap) -> freetype::FtResult<(i32, Vec)> { + fn normalize_buffer(bitmap: &freetype::bitmap::Bitmap) -> freetype::FtResult<(i32, i32, Vec)> { use freetype::bitmap::PixelMode; let buf = bitmap.buffer(); @@ -440,7 +440,18 @@ impl FreeTypeRasterizer { let stop = start + bitmap.width() as usize; packed.extend_from_slice(&buf[start..stop]); } - Ok((bitmap.width() / 3, packed)) + Ok((bitmap.rows(), bitmap.width() / 3, packed)) + }, + PixelMode::LcdV => { + for i in 0..bitmap.rows()/3 { + for j in 0..bitmap.width() { + for k in 0..3 { + let offset = ((i as usize) * 3 + k) * pitch + (j as usize); + packed.push(buf[offset]); + } + } + } + Ok((bitmap.rows() / 3, bitmap.width(), packed)) }, // Mono data is stored in a packed format using 1 bit per pixel. PixelMode::Mono => { @@ -471,7 +482,7 @@ impl FreeTypeRasterizer { byte += 1; } } - Ok((bitmap.width(), packed)) + Ok((bitmap.rows(), bitmap.width(), packed)) }, // Gray data is stored as a value between 0 and 255 using 1 byte per pixel. PixelMode::Gray => { @@ -484,7 +495,7 @@ impl FreeTypeRasterizer { packed.push(*byte); } } - Ok((bitmap.width(), packed)) + Ok((bitmap.rows(), bitmap.width(), packed)) }, mode => panic!("unhandled pixel mode: {:?}", mode) } From dbcb5885adb1f0b23c29838ef8dd837212322409 Mon Sep 17 00:00:00 2001 From: Josh Leeb-du Toit Date: Sun, 22 Jul 2018 10:38:53 +1000 Subject: [PATCH 28/32] Add binding action for hiding the window --- alacritty_macos.yml | 1 + src/config.rs | 3 ++- src/event.rs | 36 ++++++++++++++++++++++++++++++++++++ src/input.rs | 13 ++++++++++++- src/window.rs | 5 +++++ 5 files changed, 56 insertions(+), 2 deletions(-) diff --git a/alacritty_macos.yml b/alacritty_macos.yml index 4bd9c026..76a4db4a 100644 --- a/alacritty_macos.yml +++ b/alacritty_macos.yml @@ -273,6 +273,7 @@ key_bindings: - { key: C, mods: Command, action: Copy } - { key: Paste, action: Paste } - { key: Copy, action: Copy } + - { key: H, mods: Command, action: Hide } - { key: Q, mods: Command, action: Quit } - { key: W, mods: Command, action: Quit } - { key: Home, chars: "\x1bOH", mode: AppCursor } diff --git a/src/config.rs b/src/config.rs index 8d63a9c0..76daee05 100644 --- a/src/config.rs +++ b/src/config.rs @@ -549,7 +549,7 @@ impl<'a> de::Deserialize<'a> for ActionWrapper { type Value = ActionWrapper; fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("Paste, Copy, PasteSelection, IncreaseFontSize, DecreaseFontSize, ResetFontSize, or Quit") + f.write_str("Paste, Copy, PasteSelection, IncreaseFontSize, DecreaseFontSize, ResetFontSize, Hide, or Quit") } fn visit_str(self, value: &str) -> ::std::result::Result @@ -562,6 +562,7 @@ impl<'a> de::Deserialize<'a> for ActionWrapper { "IncreaseFontSize" => Action::IncreaseFontSize, "DecreaseFontSize" => Action::DecreaseFontSize, "ResetFontSize" => Action::ResetFontSize, + "Hide" => Action::Hide, "Quit" => Action::Quit, _ => return Err(E::invalid_value(Unexpected::Str(value), &self)), })) diff --git a/src/event.rs b/src/event.rs index c10f8a72..7e8a955c 100644 --- a/src/event.rs +++ b/src/event.rs @@ -40,6 +40,7 @@ pub struct ActionContext<'a, N: 'a> { pub received_count: &'a mut usize, pub suppress_chars: &'a mut bool, pub last_modifiers: &'a mut ModifiersState, + pub window_changes: &'a mut WindowChanges, } impl<'a, N: Notify + 'a> input::ActionContext for ActionContext<'a, N> { @@ -133,6 +134,33 @@ impl<'a, N: Notify + 'a> input::ActionContext for ActionContext<'a, N> { fn last_modifiers(&mut self) -> &mut ModifiersState { &mut self.last_modifiers } + + #[inline] + fn hide_window(&mut self) { + self.window_changes.hide = true; + } +} + +/// The ActionContext can't really have direct access to the Window +/// with the current design. Event handlers that want to change the +/// window must set these flags instead. The processor will trigger +/// the actual changes. +pub struct WindowChanges { + pub hide: bool, +} + +impl WindowChanges { + fn clear(&mut self) { + self.hide = false; + } +} + +impl Default for WindowChanges { + fn default() -> WindowChanges { + WindowChanges { + hide: false, + } + } } pub enum ClickState { @@ -199,6 +227,7 @@ pub struct Processor { suppress_chars: bool, last_modifiers: ModifiersState, pending_events: Vec, + window_changes: WindowChanges, } /// Notify that the terminal was resized @@ -242,6 +271,7 @@ impl Processor { suppress_chars: false, last_modifiers: Default::default(), pending_events: Vec::with_capacity(4), + window_changes: Default::default(), } } @@ -401,6 +431,7 @@ impl Processor { received_count: &mut self.received_count, suppress_chars: &mut self.suppress_chars, last_modifiers: &mut self.last_modifiers, + window_changes: &mut self.window_changes, }; processor = input::Processor { @@ -448,6 +479,11 @@ impl Processor { } } + if self.window_changes.hide { + window.hide(); + } + + self.window_changes.clear(); self.wait_for_event = !terminal.dirty; terminal diff --git a/src/input.rs b/src/input.rs index bc33094a..52775678 100644 --- a/src/input.rs +++ b/src/input.rs @@ -66,6 +66,7 @@ pub trait ActionContext { fn last_modifiers(&mut self) -> &mut ModifiersState; fn change_font_size(&mut self, delta: f32); fn reset_font_size(&mut self); + fn hide_window(&mut self); } /// Describes a state and action to take in that state @@ -170,6 +171,9 @@ pub enum Action { /// Run given command Command(String, Vec), + /// Hides the Alacritty window + Hide, + /// Quits Alacritty. Quit, } @@ -224,6 +228,9 @@ impl Action { }, } }, + Action::Hide => { + ctx.hide_window(); + }, Action::Quit => { // FIXME should do a more graceful shutdown ::std::process::exit(0); @@ -626,7 +633,7 @@ mod tests { use glutin::{VirtualKeyCode, Event, WindowEvent, ElementState, MouseButton, ModifiersState}; use term::{SizeInfo, Term, TermMode}; - use event::{Mouse, ClickState}; + use event::{Mouse, ClickState, WindowChanges}; use config::{self, Config, ClickHandler}; use index::{Point, Side}; use selection::Selection; @@ -651,6 +658,7 @@ mod tests { pub received_count: usize, pub suppress_chars: bool, pub last_modifiers: ModifiersState, + pub window_changes: &'a mut WindowChanges, } impl <'a>super::ActionContext for ActionContext<'a> { @@ -704,6 +712,8 @@ mod tests { } fn reset_font_size(&mut self) { } + fn hide_window(&mut self) { + } } macro_rules! test_clickstate { @@ -742,6 +752,7 @@ mod tests { received_count: 0, suppress_chars: false, last_modifiers: ModifiersState::default(), + window_changes: &mut WindowChanges::default(), }; let mut processor = Processor { diff --git a/src/window.rs b/src/window.rs index 1903360f..51a42232 100644 --- a/src/window.rs +++ b/src/window.rs @@ -379,6 +379,11 @@ impl Window { pub fn get_window_id(&self) -> Option { None } + + /// Hide the window + pub fn hide(&self) { + self.window.hide(); + } } pub trait OsExtensions { From ea512cb0f3cb159707eb29fdbf2e31bbb1c1b902 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Sun, 22 Jul 2018 00:44:14 +0000 Subject: [PATCH 29/32] Switch to rustup clippy component --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2dd8a4f0..d346c9f9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ env: - CLIPPY="" install: - - if [ -n "$CLIPPY" ]; then cargo install -f clippy; fi + - if [ -n "$CLIPPY" ]; then rustup component add clippy-preview; fi matrix: fast_finish: true From d25134bc6b8b13d5ff550c950c65b6e9c4a7a267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Garde?= Date: Mon, 23 Jul 2018 18:48:27 +0200 Subject: [PATCH 30/32] Add optional dim foreground color Add optional color for the dim foreground (`\e[2m;`) Defaults to 2/3 of the foreground color. (same as other colors). If a bright color is dimmed, it's displayed as the normal color. The exception for this is when the bright foreground is dimmed when no bright foreground color is set. In that case it's treated as a normal foreground color and dimmed to DimForeground. To minimize the surprise for the user, the bright and dim colors have been completely removed from the default configuration file. Some documentation has also been added to make it clear to users what these options can be used for. This fixes #1448. --- alacritty.yml | 10 +++++++++- alacritty_macos.yml | 10 +++++++++- src/ansi.rs | 5 +++++ src/config.rs | 7 +++++-- src/term/color.rs | 8 ++++++-- src/term/mod.rs | 13 ++++++++++--- 6 files changed, 44 insertions(+), 9 deletions(-) diff --git a/alacritty.yml b/alacritty.yml index 8cee1d48..be350be9 100644 --- a/alacritty.yml +++ b/alacritty.yml @@ -117,7 +117,15 @@ colors: primary: background: '0x000000' foreground: '0xeaeaea' - bright_foreground: '0xeaeaea' + + # (Optional) Bright and Dim foreground colors + # + # The dimmed foreground color is calculated automatically if it is not present. + # If the bright foreground color is not set, or `draw_bold_text_with_bright_colors` + # is `false`, the normal foreground color will be used. + # + # dim_foreground: '0x9a9a9a' + # bright_foreground: '0xffffff' # Colors the cursor will use if `custom_cursor_colors` is true cursor: diff --git a/alacritty_macos.yml b/alacritty_macos.yml index 76a4db4a..e3e57b86 100644 --- a/alacritty_macos.yml +++ b/alacritty_macos.yml @@ -95,7 +95,15 @@ colors: primary: background: '0x000000' foreground: '0xeaeaea' - bright_foreground: '0xeaeaea' + + # (Optional) Bright and Dim foreground colors + # + # The dimmed foreground color is calculated automatically if it is not present. + # If the bright foreground color is not set, or `draw_bold_text_with_bright_colors` + # is `false`, the normal foreground color will be used. + # + # dim_foreground: '0x9a9a9a' + # bright_foreground: '0xffffff' # Colors the cursor will use if `custom_cursor_colors` is true cursor: diff --git a/src/ansi.rs b/src/ansi.rs index 726550a0..f1ca759a 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -560,6 +560,8 @@ pub enum NamedColor { DimWhite, /// The bright foreground color BrightForeground, + /// Dim foreground + DimForeground, } impl NamedColor { @@ -574,6 +576,7 @@ impl NamedColor { NamedColor::Magenta => NamedColor::BrightMagenta, NamedColor::Cyan => NamedColor::BrightCyan, NamedColor::White => NamedColor::BrightWhite, + NamedColor::DimForeground => NamedColor::Foreground, NamedColor::DimBlack => NamedColor::Black, NamedColor::DimRed => NamedColor::Red, NamedColor::DimGreen => NamedColor::Green, @@ -596,6 +599,7 @@ impl NamedColor { NamedColor::Magenta => NamedColor::DimMagenta, NamedColor::Cyan => NamedColor::DimCyan, NamedColor::White => NamedColor::DimWhite, + NamedColor::Foreground => NamedColor::DimForeground, NamedColor::BrightBlack => NamedColor::Black, NamedColor::BrightRed => NamedColor::Red, NamedColor::BrightGreen => NamedColor::Green, @@ -604,6 +608,7 @@ impl NamedColor { NamedColor::BrightMagenta => NamedColor::Magenta, NamedColor::BrightCyan => NamedColor::Cyan, NamedColor::BrightWhite => NamedColor::White, + NamedColor::BrightForeground => NamedColor::Foreground, val => val } } diff --git a/src/config.rs b/src/config.rs index 76daee05..b50e3243 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1023,11 +1023,13 @@ pub struct PrimaryColors { pub background: Rgb, #[serde(deserialize_with = "rgb_from_hex")] pub foreground: Rgb, - #[serde(default, deserialize_with = "deserialize_bright_foreground")] + #[serde(default, deserialize_with = "deserialize_optional_color")] pub bright_foreground: Option, + #[serde(default, deserialize_with = "deserialize_optional_color")] + pub dim_foreground: Option, } -fn deserialize_bright_foreground<'a, D>(deserializer: D) -> ::std::result::Result, D::Error> +fn deserialize_optional_color<'a, D>(deserializer: D) -> ::std::result::Result, D::Error> where D: de::Deserializer<'a> { match Option::deserialize(deserializer) { @@ -1049,6 +1051,7 @@ impl Default for PrimaryColors { background: Rgb { r: 0, g: 0, b: 0 }, foreground: Rgb { r: 0xea, g: 0xea, b: 0xea }, bright_foreground: None, + dim_foreground: None, } } } diff --git a/src/term/color.rs b/src/term/color.rs index b84f11bd..6acd092a 100644 --- a/src/term/color.rs +++ b/src/term/color.rs @@ -4,7 +4,7 @@ use std::fmt; use {Rgb, ansi}; use config::Colors; -pub const COUNT: usize = 269; +pub const COUNT: usize = 270; /// List of indexed colors /// @@ -13,7 +13,7 @@ pub const COUNT: usize = 269; /// the configured foreground color, item 257 is the configured background /// color, item 258 is the cursor foreground color, item 259 is the cursor /// background color. Following that are 8 positions for dim colors. -/// Item 268 is the bright foreground color. +/// Item 268 is the bright foreground color, 269 the dim foreground. #[derive(Copy, Clone)] pub struct List([Rgb; COUNT]); @@ -65,6 +65,10 @@ impl List { self[ansi::NamedColor::Cursor] = colors.cursor.cursor; // Dims + self[ansi::NamedColor::DimForeground] = colors + .primary + .dim_foreground + .unwrap_or(colors.primary.foreground * 0.66); match colors.dim { Some(ref dim) => { trace!("Using config-provided dim colors"); diff --git a/src/term/mod.rs b/src/term/mod.rs index 02d846a4..fd22fe54 100644 --- a/src/term/mod.rs +++ b/src/term/mod.rs @@ -275,11 +275,18 @@ impl<'a> RenderableCellsIter<'a> { Color::Spec(rgb) => rgb, Color::Named(ansi) => { match (self.config.draw_bold_text_with_bright_colors(), cell.flags & Flags::DIM_BOLD) { + // If no bright foreground is set, treat it like the BOLD flag doesn't exist + (_, self::cell::Flags::DIM_BOLD) + if ansi == NamedColor::Foreground + && self.config.colors().primary.bright_foreground.is_none() => + { + self.colors[NamedColor::DimForeground] + } // Draw bold text in bright colors *and* contains bold flag. - (true, self::cell::Flags::DIM_BOLD) | - (true, self::cell::Flags::BOLD) => self.colors[ansi.to_bright()], + (true, self::cell::Flags::BOLD) => self.colors[ansi.to_bright()], // Cell is marked as dim and not bold - (_, self::cell::Flags::DIM) => self.colors[ansi.to_dim()], + (_, self::cell::Flags::DIM) | + (false, self::cell::Flags::DIM_BOLD) => self.colors[ansi.to_dim()], // None of the above, keep original color. _ => self.colors[ansi] } From ddb9a558170ad16f19135b2f6a5a7a7e8ac61c3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 25 Jul 2018 21:46:45 +0200 Subject: [PATCH 31/32] Fix clippy lints and run font tests on travis This fixes some existing clippy issues and runs the `font` tests through travis. Testing of copypasta crate was omitted due to problens when running on headless travis-ci environment (x11 clipboard would fail). --- .travis.yml | 1 + font/src/darwin/mod.rs | 2 +- font/src/ft/fc/mod.rs | 6 +++--- src/main.rs | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index d346c9f9..eebed8b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,3 +31,4 @@ matrix: script: - if [ -n "$CLIPPY" ]; then cargo clippy --all-features --all-targets; fi - if [ -z "$CLIPPY" ]; then cargo test; fi + - if [ -z "$CLIPPY" ]; then cargo test -p font; fi diff --git a/font/src/darwin/mod.rs b/font/src/darwin/mod.rs index 4351af61..2f9d5fe0 100644 --- a/font/src/darwin/mod.rs +++ b/font/src/darwin/mod.rs @@ -631,7 +631,7 @@ mod tests { }; print!("{}", c); } - print!("\n"); + println!(); } } } diff --git a/font/src/ft/fc/mod.rs b/font/src/ft/fc/mod.rs index 865f63c9..a999a408 100644 --- a/font/src/ft/fc/mod.rs +++ b/font/src/ft/fc/mod.rs @@ -326,7 +326,7 @@ mod tests { print!("embeddedbitmap={:?}; ", font.embeddedbitmap()); print!("lcdfilter={:?}; ", font.lcdfilter()); print!("hintstyle={:?}", font.hintstyle()); - println!(""); + println!(); } #[test] @@ -346,7 +346,7 @@ mod tests { print!("style={:?}; ", font.style()); print!("rgba={:?}", font.rgba()); print!("rgba={:?}", font.rgba()); - println!(""); + println!(); } } @@ -367,7 +367,7 @@ mod tests { print!("family={:?}; ", font.family()); print!("style={:?}; ", font.style()); print!("rgba={:?}", font.rgba()); - println!(""); + println!(); } } } diff --git a/src/main.rs b/src/main.rs index f7a1fa1a..fc6b0821 100644 --- a/src/main.rs +++ b/src/main.rs @@ -180,7 +180,7 @@ fn run(mut config: Config, options: &cli::Options) -> Result<(), Box> { .as_ref() .and_then(|monitor| monitor.pending_config()) { - config = new_config.update_dynamic_title(&options); + config = new_config.update_dynamic_title(options); display.update_config(&config); processor.update_config(&config); terminal.update_config(&config); From 57a455e5f209dd965fd6b495d7f2b033fd5288c0 Mon Sep 17 00:00:00 2001 From: Christian Duerr Date: Wed, 25 Jul 2018 21:05:49 +0000 Subject: [PATCH 32/32] Ignore errors when logger can't write to output The (e)print macro will panic when there is no output available to write to, however in our scenario where we only log user errors to stderr, the better choice would be to ignore when writing to stdout or stderr is not possible. This changes the (e)print macro to make use of `write` and ignore any potential errors. Since (e)println rely on (e)print, this also solves potential failuers when calling (e)println. With this change implemented, all of logging, (e)println and (e)print should never fail even if the stdout/stderr is not available. --- src/logging.rs | 2 +- src/macros.rs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/logging.rs b/src/logging.rs index a691778a..10929980 100644 --- a/src/logging.rs +++ b/src/logging.rs @@ -47,7 +47,7 @@ impl log::Log for Logger { fn log(&self, record: &log::Record) { if self.enabled(record.metadata()) && record.target().starts_with("alacritty") { if let Ok(ref mut writer) = self.output.lock() { - writer.write_all(format!("{}\n", record.args()).as_ref()).expect("Error while logging!"); + let _ = writer.write_all(format!("{}\n", record.args()).as_ref()); } } } diff --git a/src/macros.rs b/src/macros.rs index 35e69f2d..464110e6 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -29,3 +29,19 @@ macro_rules! maybe { } } } + +#[macro_export] +macro_rules! print { + ($($arg:tt)*) => {{ + use std::io::Write; + let _ = write!(::std::io::stdout(), $($arg)*); + }}; +} + +#[macro_export] +macro_rules! eprint { + ($($arg:tt)*) => {{ + use std::io::Write; + let _ = write!(::std::io::stderr(), $($arg)*); + }}; +}