From 01571f6f805a37b5e89b8210c3bbae87969d6b0e Mon Sep 17 00:00:00 2001 From: Lutetium-Vanadium Date: Wed, 11 May 2022 17:49:07 +0530 Subject: [PATCH] update dependencies --- Cargo.toml | 6 ++++-- requestty-macro/Cargo.toml | 2 +- requestty-ui/Cargo.toml | 12 +++++++----- requestty-ui/src/lib.rs | 2 +- requestty-ui/src/widgets.rs | 8 ++++---- src/lib.rs | 2 +- 6 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 19d30d0..e6c0f6f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,12 +26,14 @@ macro = { package = "requestty-macro", path = "./requestty-macro", optional = tr tempfile = "3" -smallvec = { version = "1.6", optional = true } +smallvec = { version = "1.8", optional = true } [dev-dependencies] trybuild = { version = "1.0.42", features = ["diff"] } # remove color printing since it messes with the snapshot's colours -insta = { version = "1.7.1", default-features = false } +# restrict to 1.11 due to the change in the working of autogenerated names +# (https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md#1120) +insta = { version = "=1.11", default-features = false } rand = "0.8" rand_chacha = "0.3" diff --git a/requestty-macro/Cargo.toml b/requestty-macro/Cargo.toml index e681ce8..999e855 100644 --- a/requestty-macro/Cargo.toml +++ b/requestty-macro/Cargo.toml @@ -17,5 +17,5 @@ proc-macro = true proc-macro2 = "1" syn = { version = "1", features = ["full"] } quote = "1" -bitflags = "1.2" +bitflags = "1.3" rustversion = "1.0" diff --git a/requestty-ui/Cargo.toml b/requestty-ui/Cargo.toml index d00d28b..37ed275 100644 --- a/requestty-ui/Cargo.toml +++ b/requestty-ui/Cargo.toml @@ -14,16 +14,18 @@ categories = ["command-line-interface", "command-line-utilities"] exclude = ["*-snapshots"] [dependencies] -bitflags = "1.2" -textwrap = "0.14" -unicode-segmentation = "1.7" +bitflags = "1.3" +textwrap = "0.15" +unicode-segmentation = "1.9" -crossterm = { version = "0.22", optional = true } +crossterm = { version = "0.23", optional = true } termion = { version = "1.5", optional = true } [dev-dependencies] # remove color printing since it messes with the snapshot's colours -insta = { version = "1.7.1", default-features = false } +# restrict to 1.11 due to the change in the working of autogenerated names +# (https://github.com/mitsuhiko/insta/blob/master/CHANGELOG.md#1120) +insta = { version = "=1.11", default-features = false } [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] diff --git a/requestty-ui/src/lib.rs b/requestty-ui/src/lib.rs index 764edc7..0349f4b 100644 --- a/requestty-ui/src/lib.rs +++ b/requestty-ui/src/lib.rs @@ -20,7 +20,7 @@ missing_docs, missing_debug_implementations, unreachable_pub, - broken_intra_doc_links + rustdoc::broken_intra_doc_links )] #![warn(rust_2018_idioms)] #![cfg_attr(docsrs, feature(doc_cfg))] diff --git a/requestty-ui/src/widgets.rs b/requestty-ui/src/widgets.rs index 604e7db..a646448 100644 --- a/requestty-ui/src/widgets.rs +++ b/requestty-ui/src/widgets.rs @@ -2,7 +2,7 @@ use std::io; -use textwrap::{core::Fragment, word_separators::WordSeparator}; +use textwrap::{core::Fragment, WordSeparator}; use crate::{backend::Backend, events::KeyEvent, layout::Layout}; @@ -84,8 +84,8 @@ impl + ?Sized> Widget for T { let mut prev_whitespace_len = 0; let max_width = max_width - 3; // leave space for the '...' - for word in textwrap::word_separators::UnicodeBreakProperties.find_words(self) { - width += word.width() + prev_whitespace_len; + for word in WordSeparator::UnicodeBreakProperties.find_words(self) { + width += word.width() as usize + prev_whitespace_len; if width > max_width { break; } @@ -96,7 +96,7 @@ impl + ?Sized> Widget for T { } backend.write_all(word.as_bytes())?; - prev_whitespace_len = word.whitespace_width(); + prev_whitespace_len = word.whitespace_width() as usize; } backend.write_all(b"...")?; diff --git a/src/lib.rs b/src/lib.rs index b65fe78..b470e73 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -142,7 +142,7 @@ missing_docs, missing_debug_implementations, unreachable_pub, - broken_intra_doc_links + rustdoc::broken_intra_doc_links )] #![warn(rust_2018_idioms)] #![cfg_attr(docsrs, feature(doc_cfg))]