diff --git a/term/Cargo.toml b/term/Cargo.toml index 940f638f2..02635574c 100644 --- a/term/Cargo.toml +++ b/term/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" bitflags = "~1.0" failure = "~0.1" image = "0.21" -ordered-float = "~0.5" +ordered-float = "1.0" unicode-segmentation = "~1.2" unicode-width = "~0.1" serde = {version="~1.0", features = ["rc"]} diff --git a/term/src/terminalstate.rs b/term/src/terminalstate.rs index a0e98a4e3..b5c369db2 100644 --- a/term/src/terminalstate.rs +++ b/term/src/terminalstate.rs @@ -4,7 +4,7 @@ use super::*; use failure::bail; use image::{self, GenericImageView}; -use ordered_float::NotNaN; +use ordered_float::NotNan; use std::fmt::Write; use std::sync::Arc; use termwiz::escape::csi::{ @@ -1315,7 +1315,7 @@ impl TerminalState { let image_data = Arc::new(ImageData::with_raw_data(image.data)); - let mut ypos = NotNaN::new(0.0).unwrap(); + let mut ypos = NotNan::new(0.0).unwrap(); let cursor_x = self.cursor.x; let x_delta = 1.0 / available_pixel_width as f32; let y_delta = 1.0 / available_pixel_height as f32; @@ -1324,7 +1324,7 @@ impl TerminalState { width_in_cells, height_in_cells, width, height ); for _ in 0..height_in_cells { - let mut xpos = NotNaN::new(0.0).unwrap(); + let mut xpos = NotNan::new(0.0).unwrap(); let cursor_y = self.cursor.y; eprintln!( "setting cells for y={} x=[{}..{}]", diff --git a/termwiz/Cargo.toml b/termwiz/Cargo.toml index c0b2d89ea..e272a5232 100644 --- a/termwiz/Cargo.toml +++ b/termwiz/Cargo.toml @@ -1,36 +1,37 @@ [package] authors = ["Wez Furlong"] name = "termwiz" -version = "0.1.0" +version = "0.2" edition = "2018" repository = "https://github.com/wez/wezterm" description = "Terminal Wizardry for Unix and Windows" license = "MIT" documentation = "https://docs.rs/termwiz" keywords = ["terminal", "readline", "console", "curses"] +readme = "README.md" [dependencies] -base64 = "~0.9" -bitflags = "~1.0" -cassowary = "~0.3" -derive_builder = "~0.5" -failure = "~0.1" -fnv = "~1.0" +base64 = "0.10" +bitflags = "1.0" +cassowary = "0.3" +derive_builder = "0.7" +failure = "0.1" +fnv = "1.0" image = "0.21" -libc = "~0.2" -memmem = "~0.1" -num = "~0.2" -num-traits = "~0.2" -ordered-float = "~0.5" -palette = "~0.4" -regex = "~0.2" +libc = "0.2" +memmem = "0.1" +num = "0.2" +num-traits = "0.2" +ordered-float = "1.0" +palette = "0.4" +regex = "0.2" semver = "0.9" -serde = {version="~1.0", features = ["rc"]} -serde_derive = "~1.0" -smallvec = "~0.6" -terminfo = "~0.6" -unicode-segmentation = "~1.2" -unicode-width = "~0.1" +serde = {version="1.0", features = ["rc"]} +serde_derive = "1.0" +smallvec = "0.6" +terminfo = "0.6" +unicode-segmentation = "1.2" +unicode-width = "0.1" vte = "0.3" [dev-dependencies] @@ -38,10 +39,10 @@ varbincode = "0.1" [dependencies.num-derive] features = ["full-syntax"] -version = "~0.2" +version = "0.2" [target."cfg(unix)".dependencies] -signal-hook = "~0.1" -termios = "~0.3" +signal-hook = "0.1" +termios = "0.3" [target."cfg(windows)".dependencies.winapi] features = [ "winbase", @@ -52,4 +53,4 @@ features = [ "fileapi", "synchapi", ] -version = "~0.3" +version = "0.3" diff --git a/termwiz/src/escape/osc.rs b/termwiz/src/escape/osc.rs index fbe61be60..af9f18f0f 100644 --- a/termwiz/src/escape/osc.rs +++ b/termwiz/src/escape/osc.rs @@ -4,7 +4,7 @@ use bitflags::bitflags; use failure::{bail, ensure, err_msg, Fallible}; use num; use num_derive::*; -use ordered_float::NotNaN; +use ordered_float::NotNan; use std::collections::HashMap; use std::fmt::{Display, Error as FmtError, Formatter}; use std::str; @@ -251,8 +251,8 @@ pub enum ITermProprietary { /// The response to RequestCellSize. The height and width are the dimensions /// of a cell measured in points ReportCellSize { - height_points: NotNaN, - width_points: NotNaN, + height_points: NotNan, + width_points: NotNan, }, /// Place a string in the systems pasteboard Copy(String), @@ -539,8 +539,8 @@ impl ITermProprietary { if osc.len() == 3 && keyword == "ReportCellSize" && p1.is_some() { if let Some(p1) = p1 { return Ok(ITermProprietary::ReportCellSize { - height_points: NotNaN::new(p1.parse()?)?, - width_points: NotNaN::new(String::from_utf8_lossy(osc[2]).parse()?)?, + height_points: NotNan::new(p1.parse()?)?, + width_points: NotNan::new(String::from_utf8_lossy(osc[2]).parse()?)?, }); } } @@ -728,8 +728,8 @@ mod test { "\x1b]1337;ReportCellSize=12;15.5\x07" ), OperatingSystemCommand::ITermProprietary(ITermProprietary::ReportCellSize { - height_points: NotNaN::new(12.0).unwrap(), - width_points: NotNaN::new(15.5).unwrap() + height_points: NotNan::new(12.0).unwrap(), + width_points: NotNan::new(15.5).unwrap() }) ); diff --git a/termwiz/src/image.rs b/termwiz/src/image.rs index 880127ae5..ecc543491 100644 --- a/termwiz/src/image.rs +++ b/termwiz/src/image.rs @@ -11,21 +11,21 @@ // protocol appears to track the images out of band as attachments with // z-order. -use ordered_float::NotNaN; +use ordered_float::NotNan; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use serde_derive::*; use std::sync::Arc; -fn deserialize_notnan<'de, D>(deserializer: D) -> Result, D::Error> +fn deserialize_notnan<'de, D>(deserializer: D) -> Result, D::Error> where D: Deserializer<'de>, { let value = f32::deserialize(deserializer)?; - NotNaN::new(value).map_err(|e| serde::de::Error::custom(format!("{:?}", e))) + NotNan::new(value).map_err(|e| serde::de::Error::custom(format!("{:?}", e))) } #[cfg_attr(feature = "cargo-clippy", allow(clippy::trivially_copy_pass_by_ref))] -fn serialize_notnan(value: &NotNaN, serializer: S) -> Result +fn serialize_notnan(value: &NotNan, serializer: S) -> Result where S: Serializer, { @@ -38,22 +38,22 @@ pub struct TextureCoordinate { deserialize_with = "deserialize_notnan", serialize_with = "serialize_notnan" )] - pub x: NotNaN, + pub x: NotNan, #[serde( deserialize_with = "deserialize_notnan", serialize_with = "serialize_notnan" )] - pub y: NotNaN, + pub y: NotNan, } impl TextureCoordinate { - pub fn new(x: NotNaN, y: NotNaN) -> Self { + pub fn new(x: NotNan, y: NotNan) -> Self { Self { x, y } } pub fn new_f32(x: f32, y: f32) -> Self { - let x = NotNaN::new(x).unwrap(); - let y = NotNaN::new(y).unwrap(); + let x = NotNan::new(x).unwrap(); + let y = NotNan::new(y).unwrap(); Self::new(x, y) } } diff --git a/termwiz/src/surface/mod.rs b/termwiz/src/surface/mod.rs index ae494c2b4..c64c40d59 100644 --- a/termwiz/src/surface/mod.rs +++ b/termwiz/src/surface/mod.rs @@ -1,7 +1,7 @@ use crate::cell::{AttributeChange, Cell, CellAttributes}; use crate::color::ColorAttribute; use crate::image::ImageCell; -use ordered_float::NotNaN; +use ordered_float::NotNan; use serde_derive::*; use std::borrow::Cow; use std::cmp::min; @@ -277,9 +277,9 @@ impl Surface { self.ypos -= scroll; } - let mut ypos = NotNaN::new(0.0).unwrap(); + let mut ypos = NotNan::new(0.0).unwrap(); for y in 0..image.height { - let mut xpos = NotNaN::new(0.0).unwrap(); + let mut xpos = NotNan::new(0.0).unwrap(); for x in 0..image.width { self.lines[self.ypos + y].set_cell( self.xpos + x,