diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bb29f37..20294d4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Crash due to assertion failure on 32-bit architectures - Segmentation fault on shutdown with Wayland - Incorrect estimated DPR with Wayland +- Consecutive clipboard stores dropped on Wayland until the application is refocused ## 0.7.1 diff --git a/Cargo.lock b/Cargo.lock index 1add709c..4292a80a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "ab_glyph_rasterizer" version = "0.1.4" @@ -179,9 +181,9 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "calloop" @@ -245,15 +247,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "cloudabi" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" -dependencies = [ - "bitflags", -] - [[package]] name = "cmake" version = "0.1.45" @@ -426,11 +419,11 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", ] [[package]] @@ -502,9 +495,9 @@ dependencies = [ [[package]] name = "derivative" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", @@ -575,10 +568,11 @@ dependencies = [ [[package]] name = "embed-resource" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b2f39c0462f098c1ca4abc408f7482949bbe2ab19bca5a4419f91f69e5bccc" +checksum = "0bd6a41d89e233bcd6978fe7333191a2054d518d105a1165ada1d2ebc445ce98" dependencies = [ + "cc", "vswhom", "winreg", ] @@ -595,13 +589,13 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e" +checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.2.4", "winapi 0.3.9", ] @@ -712,11 +706,11 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "getrandom" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -806,9 +800,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" dependencies = [ "libc", ] @@ -832,20 +826,20 @@ dependencies = [ [[package]] name = "inotify-sys" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4563555856585ab3180a5bf0b2f9f8d301a728462afffc8195b3f5394229c55" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" dependencies = [ "libc", ] [[package]] name = "instant" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66" +checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", ] [[package]] @@ -905,25 +899,25 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.81" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" [[package]] name = "libloading" -version = "0.6.4" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3557c9384f7f757f6d139cd3a4c62ef4e850696c16bf27924a5538c8a09717a1" +checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "winapi 0.3.9", ] [[package]] name = "linked-hash-map" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" @@ -936,11 +930,11 @@ dependencies = [ [[package]] name = "log" -version = "0.4.11" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "serde", ] @@ -1118,9 +1112,9 @@ dependencies = [ [[package]] name = "nom" -version = "6.0.1" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88034cfd6b4a0d54dd14f4a507eceee36c0b70e5a02236c4e4df571102be17f0" +checksum = "ab6f70b46d6325aa300f1c7bb3d470127dfc27806d8ea6bf294ee0ce643ce2b1" dependencies = [ "memchr", "version_check", @@ -1232,15 +1226,14 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" +checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" dependencies = [ - "cfg-if 0.1.10", - "cloudabi", + "cfg-if 1.0.0", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.4", "smallvec", "winapi 0.3.9", ] @@ -1288,9 +1281,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" dependencies = [ "proc-macro2", ] @@ -1310,6 +1303,15 @@ version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +[[package]] +name = "redox_syscall" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ec8ca9416c5ea37062b502703cd7fcb207736bc294f6e0cf367ac6fc234570" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.3.5" @@ -1317,7 +1319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" dependencies = [ "getrandom", - "redox_syscall", + "redox_syscall 0.1.57", "rust-argon2", ] @@ -1333,9 +1335,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.21" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" +checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" [[package]] name = "rust-argon2" @@ -1388,18 +1390,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.118" +version = "1.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.118" +version = "1.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" dependencies = [ "proc-macro2", "quote", @@ -1408,9 +1410,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" +checksum = "ea1c6153794552ea7cf7cf63b1231a25de00ec90db326ba6264440fa08e31486" dependencies = [ "itoa", "ryu", @@ -1419,9 +1421,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.14" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7baae0a99f1a324984bcdc5f0718384c1f69775f1c7eec8b859b71b443e3fd7" +checksum = "15654ed4ab61726bf918a39cb8d98a2e2995b002387807fa6ba58fdf7f59bb23" dependencies = [ "dtoa", "linked-hash-map", @@ -1488,9 +1490,9 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smallvec" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae524f056d7d770e174287294f562e95044c68e88dec909a00d2094805db9d75" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "smithay-client-toolkit" @@ -1513,9 +1515,9 @@ dependencies = [ [[package]] name = "smithay-clipboard" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab88b219728cad0697a6c9e75da50bf5220ba01b3485e33e407931539a8ebc91" +checksum = "06384dfaf645908220d976ae24ed39f6cf92efecb0225ea0a948e403014de527" dependencies = [ "smithay-client-toolkit", "wayland-client", @@ -1552,9 +1554,9 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "syn" -version = "1.0.56" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9802ddde94170d186eeee5005b798d9c159fa970403f1be19976d0cfb939b72" +checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" dependencies = [ "proc-macro2", "quote", @@ -1955,9 +1957,9 @@ checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" [[package]] name = "yaml-rust" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f0c922f1a334134dc2f7a8b67dc5d25f0735263feec974345ff706bcf20b0d" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" dependencies = [ "linked-hash-map", ] diff --git a/alacritty/src/config/mod.rs b/alacritty/src/config/mod.rs index 0673ffd5..08cc2083 100644 --- a/alacritty/src/config/mod.rs +++ b/alacritty/src/config/mod.rs @@ -1,5 +1,5 @@ use std::fmt::{self, Display, Formatter}; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::{env, fs, io}; use log::{error, info}; @@ -23,12 +23,12 @@ use crate::cli::Options; pub use crate::config::bindings::{Action, Binding, BindingMode, Key, SearchAction, ViAction}; #[cfg(test)] pub use crate::config::mouse::{ClickHandler, Mouse}; -use crate::config::ui_config::UIConfig; +use crate::config::ui_config::UiConfig; /// Maximum number of depth for the configuration file imports. const IMPORT_RECURSION_LIMIT: usize = 5; -pub type Config = TermConfig; +pub type Config = TermConfig; /// Result from config loading. pub type Result = std::result::Result; @@ -123,7 +123,7 @@ pub fn load(options: &Options) -> Config { } /// Attempt to reload the configuration file. -pub fn reload(config_path: &PathBuf, options: &Options) -> Result { +pub fn reload(config_path: &Path, options: &Options) -> Result { // Load config, propagating errors. let config_options = options.config_options().clone(); let mut config = load_from(&config_path, config_options)?; @@ -135,7 +135,7 @@ pub fn reload(config_path: &PathBuf, options: &Options) -> Result { } /// Load configuration file and log errors. -fn load_from(path: &PathBuf, cli_config: Value) -> Result { +fn load_from(path: &Path, cli_config: Value) -> Result { match read_config(path, cli_config) { Ok(config) => Ok(config), Err(err) => { @@ -146,7 +146,7 @@ fn load_from(path: &PathBuf, cli_config: Value) -> Result { } /// Deserialize configuration file from path. -fn read_config(path: &PathBuf, cli_config: Value) -> Result { +fn read_config(path: &Path, cli_config: Value) -> Result { let mut config_paths = Vec::new(); let mut config_value = parse_config(&path, &mut config_paths, IMPORT_RECURSION_LIMIT)?; @@ -162,7 +162,7 @@ fn read_config(path: &PathBuf, cli_config: Value) -> Result { /// Deserialize all configuration files as generic Value. fn parse_config( - path: &PathBuf, + path: &Path, config_paths: &mut Vec, recursion_limit: usize, ) -> Result { diff --git a/alacritty/src/config/ui_config.rs b/alacritty/src/config/ui_config.rs index 25f9fb91..4d23e2c8 100644 --- a/alacritty/src/config/ui_config.rs +++ b/alacritty/src/config/ui_config.rs @@ -13,7 +13,7 @@ use crate::config::mouse::Mouse; use crate::config::window::WindowConfig; #[derive(ConfigDeserialize, Debug, PartialEq)] -pub struct UIConfig { +pub struct UiConfig { /// Font configuration. pub font: Font, @@ -45,7 +45,7 @@ pub struct UIConfig { background_opacity: Percentage, } -impl Default for UIConfig { +impl Default for UiConfig { fn default() -> Self { Self { alt_send_esc: true, @@ -62,7 +62,7 @@ impl Default for UIConfig { } } -impl UIConfig { +impl UiConfig { #[inline] pub fn background_opacity(&self) -> f32 { self.background_opacity.as_f32() diff --git a/alacritty/src/event.rs b/alacritty/src/event.rs index 45aabca1..40730ab8 100644 --- a/alacritty/src/event.rs +++ b/alacritty/src/event.rs @@ -12,7 +12,7 @@ use std::fs::File; use std::io::Write; use std::mem; use std::ops::RangeInclusive; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; #[cfg(not(any(target_os = "macos", windows)))] use std::sync::atomic::Ordering; use std::sync::Arc; @@ -66,7 +66,7 @@ const MAX_HISTORY_SIZE: usize = 255; #[derive(Debug, Clone)] pub enum Event { TerminalEvent(TerminalEvent), - DPRChanged(f64, (u32, u32)), + DprChanged(f64, (u32, u32)), Scroll(Scroll), ConfigReload(PathBuf), Message(Message), @@ -989,7 +989,7 @@ impl Processor { } => { *control_flow = ControlFlow::Poll; let size = (new_inner_size.width, new_inner_size.height); - self.event_queue.push(Event::DPRChanged(scale_factor, size).into()); + self.event_queue.push(Event::DprChanged(scale_factor, size).into()); return; }, // Transmute to extend lifetime, which exists only for `ScaleFactorChanged` event. @@ -1084,7 +1084,7 @@ impl Processor { { match event { GlutinEvent::UserEvent(event) => match event { - Event::DPRChanged(scale_factor, (width, height)) => { + Event::DprChanged(scale_factor, (width, height)) => { let display_update_pending = &mut processor.ctx.display_update_pending; // Push current font to update its DPR. @@ -1253,7 +1253,7 @@ impl Processor { } fn reload_config( - path: &PathBuf, + path: &Path, processor: &mut input::Processor<'_, T, ActionContext<'_, N, T>>, ) where T: EventListener, diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs index 39e53b82..390557d9 100644 --- a/alacritty/src/renderer/mod.rs +++ b/alacritty/src/renderer/mod.rs @@ -21,7 +21,7 @@ use alacritty_terminal::term::render::RenderableCell; use alacritty_terminal::term::SizeInfo; use crate::config::font::{Font, FontDescription}; -use crate::config::ui_config::{Delta, UIConfig}; +use crate::config::ui_config::{Delta, UiConfig}; use crate::gl; use crate::gl::types::*; use crate::renderer::rects::{RectRenderer, RenderRect}; @@ -448,7 +448,7 @@ pub struct RenderApi<'a> { atlas: &'a mut Vec, current_atlas: &'a mut usize, program: &'a mut TextShaderProgram, - config: &'a UIConfig, + config: &'a UiConfig, } #[derive(Debug)] @@ -682,7 +682,7 @@ impl QuadRenderer { } } - pub fn with_api(&mut self, config: &UIConfig, props: &SizeInfo, func: F) -> T + pub fn with_api(&mut self, config: &UiConfig, props: &SizeInfo, func: F) -> T where F: FnOnce(RenderApi<'_>) -> T, { diff --git a/alacritty/src/wayland_theme.rs b/alacritty/src/wayland_theme.rs index 5d3bd922..1c0d63bf 100644 --- a/alacritty/src/wayland_theme.rs +++ b/alacritty/src/wayland_theme.rs @@ -69,11 +69,11 @@ impl WaylandTheme for AlacrittyWaylandTheme { } } -trait IntoARGBColor { +trait IntoArgbColor { fn into_rgba(self) -> ARGBColor; } -impl IntoARGBColor for Rgb { +impl IntoArgbColor for Rgb { fn into_rgba(self) -> ARGBColor { ARGBColor { a: 0xff, r: self.r, g: self.g, b: self.b } } diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 2bd445ea..68700b8b 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -372,7 +372,7 @@ impl Default for CursorShape { pub enum Mode { /// ?1 CursorKeys = 1, - /// Select 80 or 132 columns per page. + /// Select 80 or 132 columns per page (DECCOLM). /// /// CSI ? 3 h -> set 132 column font. /// CSI ? 3 l -> reset 80 column font. @@ -383,7 +383,7 @@ pub enum Mode { /// * erases all data in page memory /// * resets DECLRMM to unavailable /// * clears data from the status line (if set to host-writable) - DECCOLM = 3, + ColumnMode = 3, /// IRM Insert Mode. /// /// NB should be part of non-private mode enum. @@ -440,7 +440,7 @@ impl Mode { if private { Some(match num { 1 => Mode::CursorKeys, - 3 => Mode::DECCOLM, + 3 => Mode::ColumnMode, 6 => Mode::Origin, 7 => Mode::LineWrap, 12 => Mode::BlinkingCursor, @@ -1406,7 +1406,7 @@ mod tests { let mut parser = Processor::new(); let mut handler = MockHandler::default(); - for byte in &BYTES[..] { + for byte in BYTES { parser.advance(&mut handler, *byte, &mut io::sink()); } @@ -1420,7 +1420,7 @@ mod tests { let mut parser = Processor::new(); let mut handler = MockHandler::default(); - for byte in &bytes[..] { + for byte in bytes { parser.advance(&mut handler, *byte, &mut io::sink()); } @@ -1429,7 +1429,7 @@ mod tests { let bytes: &[u8] = &[0x1b, b'[', b'c']; - for byte in &bytes[..] { + for byte in bytes { parser.advance(&mut handler, *byte, &mut io::sink()); } @@ -1438,7 +1438,7 @@ mod tests { let bytes: &[u8] = &[0x1b, b'[', b'0', b'c']; - for byte in &bytes[..] { + for byte in bytes { parser.advance(&mut handler, *byte, &mut io::sink()); } @@ -1452,7 +1452,7 @@ mod tests { let mut parser = Processor::new(); let mut handler = MockHandler::default(); - for byte in &bytes[..] { + for byte in bytes { parser.advance(&mut handler, *byte, &mut io::sink()); } @@ -1464,7 +1464,7 @@ mod tests { let mut parser = Processor::new(); let mut handler = MockHandler::default(); - for byte in &bytes[..] { + for byte in bytes { parser.advance(&mut handler, *byte, &mut io::sink()); } @@ -1482,7 +1482,7 @@ mod tests { let mut parser = Processor::new(); let mut handler = MockHandler::default(); - for byte in &BYTES[..] { + for byte in BYTES { parser.advance(&mut handler, *byte, &mut io::sink()); } @@ -1513,7 +1513,7 @@ mod tests { let mut handler = MockHandler::default(); let mut parser = Processor::new(); - for byte in &BYTES[..] { + for byte in BYTES { parser.advance(&mut handler, *byte, &mut io::sink()); } } @@ -1524,7 +1524,7 @@ mod tests { let mut parser = Processor::new(); let mut handler = MockHandler::default(); - for byte in &BYTES[..] { + for byte in BYTES { parser.advance(&mut handler, *byte, &mut io::sink()); } diff --git a/alacritty_terminal/src/config/mod.rs b/alacritty_terminal/src/config/mod.rs index 9b6f695f..766b1d95 100644 --- a/alacritty_terminal/src/config/mod.rs +++ b/alacritty_terminal/src/config/mod.rs @@ -127,8 +127,8 @@ impl Cursor { } } -#[serde(untagged)] #[derive(Deserialize, Debug, Copy, Clone, PartialEq, Eq)] +#[serde(untagged)] pub enum ConfigCursorStyle { Shape(CursorShape), WithBlinking { @@ -190,14 +190,14 @@ impl CursorBlinking { } } -impl Into for CursorBlinking { - fn into(self) -> bool { - self == Self::On || self == Self::Always +impl From for bool { + fn from(cursor_blinking: CursorBlinking) -> bool { + cursor_blinking == CursorBlinking::On || cursor_blinking == CursorBlinking::Always } } -#[serde(untagged)] #[derive(Deserialize, Debug, Clone, PartialEq, Eq)] +#[serde(untagged)] pub enum Program { Just(String), WithArgs { diff --git a/alacritty_terminal/src/event_loop.rs b/alacritty_terminal/src/event_loop.rs index 2fe3f64e..8a6441ce 100644 --- a/alacritty_terminal/src/event_loop.rs +++ b/alacritty_terminal/src/event_loop.rs @@ -221,7 +221,7 @@ where let mut terminal = None; loop { - match self.pty.reader().read(&mut buf[..]) { + match self.pty.reader().read(buf) { Ok(0) => break, Ok(got) => { // Record bytes read; used to limit time spent in pty_read. diff --git a/alacritty_terminal/src/term/color.rs b/alacritty_terminal/src/term/color.rs index 88af6de6..76a2577b 100644 --- a/alacritty_terminal/src/term/color.rs +++ b/alacritty_terminal/src/term/color.rs @@ -117,7 +117,7 @@ impl<'de> Deserialize<'de> for Rgb { where E: serde::de::Error, { - Rgb::from_str(&value[..]).map_err(|_| { + Rgb::from_str(value).map_err(|_| { E::custom(format!( "failed to parse rgb color {}; expected hex color like #ff00ff", value @@ -221,7 +221,7 @@ impl<'de> Deserialize<'de> for CellRgb { _ => (), } - Rgb::from_str(&value[..]).map(CellRgb::Rgb).map_err(|_| { + Rgb::from_str(value).map(CellRgb::Rgb).map_err(|_| { E::custom(format!("failed to parse color {}; expected {}", value, EXPECTING)) }) } diff --git a/alacritty_terminal/src/term/mod.rs b/alacritty_terminal/src/term/mod.rs index 70d670fe..3fb2df5a 100644 --- a/alacritty_terminal/src/term/mod.rs +++ b/alacritty_terminal/src/term/mod.rs @@ -1761,7 +1761,7 @@ impl Handler for Term { ansi::Mode::LineWrap => self.mode.insert(TermMode::LINE_WRAP), ansi::Mode::LineFeedNewLine => self.mode.insert(TermMode::LINE_FEED_NEW_LINE), ansi::Mode::Origin => self.mode.insert(TermMode::ORIGIN), - ansi::Mode::DECCOLM => self.deccolm(), + ansi::Mode::ColumnMode => self.deccolm(), ansi::Mode::Insert => self.mode.insert(TermMode::INSERT), ansi::Mode::BlinkingCursor => { let style = self.cursor_style.get_or_insert(self.default_cursor_style); @@ -1803,7 +1803,7 @@ impl Handler for Term { ansi::Mode::LineWrap => self.mode.remove(TermMode::LINE_WRAP), ansi::Mode::LineFeedNewLine => self.mode.remove(TermMode::LINE_FEED_NEW_LINE), ansi::Mode::Origin => self.mode.remove(TermMode::ORIGIN), - ansi::Mode::DECCOLM => self.deccolm(), + ansi::Mode::ColumnMode => self.deccolm(), ansi::Mode::Insert => self.mode.remove(TermMode::INSERT), ansi::Mode::BlinkingCursor => { let style = self.cursor_style.get_or_insert(self.default_cursor_style); @@ -2429,7 +2429,7 @@ mod benches { mem::swap(&mut terminal.grid, &mut grid); b.iter(|| { - let iter = terminal.renderable_cells(&config, true); + let iter = terminal.renderable_content(&config, true); for cell in iter { test::black_box(cell); }