aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.builds/linux.yml6
-rw-r--r--CHANGELOG.md4
-rw-r--r--Cargo.toml3
-rw-r--r--src/lib.rs11
-rw-r--r--utf8parse/src/lib.rs2
-rw-r--r--vte_generate_state_changes/src/lib.rs8
6 files changed, 19 insertions, 15 deletions
diff --git a/.builds/linux.yml b/.builds/linux.yml
index 7430c52..a574963 100644
--- a/.builds/linux.yml
+++ b/.builds/linux.yml
@@ -14,8 +14,8 @@ tasks:
$HOME/.cargo/bin/rustup toolchain install nightly -c rustfmt
cd vte
$HOME/.cargo/bin/cargo +nightly fmt -- --check
- - 1-36-0: |
- $HOME/.cargo/bin/rustup toolchain install --profile minimal 1.36.0
+ - 1-56-0: |
+ $HOME/.cargo/bin/rustup toolchain install --profile minimal 1.56.0
cd vte
rm Cargo.lock
- $HOME/.cargo/bin/cargo +1.36.0 test
+ $HOME/.cargo/bin/cargo +1.56.0 test
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f094a89..df9e8f0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,10 @@
CHANGELOG
=========
+## Unreleased
+
+- Minimum rust version has been bumped to 1.56.0
+
## 0.10.1
- Fixed invalid intermediates when transitioning from DCS to ESC
diff --git a/Cargo.toml b/Cargo.toml
index 9d91d6b..2b1e184 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,7 +10,8 @@ readme = "README.md"
license = "Apache-2.0 OR MIT"
version = "0.10.1"
name = "vte"
-edition = "2018"
+edition = "2021"
+rust-version = "1.56.0"
[dependencies]
vte_generate_state_changes = { version = "0.1.0", path = "vte_generate_state_changes" }
diff --git a/src/lib.rs b/src/lib.rs
index 157392a..c9886bf 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -30,7 +30,7 @@
//! [`Parser`]: struct.Parser.html
//! [`Perform`]: trait.Perform.html
//! [Paul Williams' ANSI parser state machine]: https://vt100.net/emu/dec_ansi_parser
-#![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use, clippy::wrong_pub_self_convention)]
+#![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use)]
#![cfg_attr(all(feature = "nightly", test), feature(test))]
#![cfg_attr(feature = "no_std", no_std)]
@@ -420,7 +420,6 @@ extern crate std;
mod tests {
use super::*;
- use std::string::String;
use std::vec::Vec;
static OSC_BYTES: &[u8] = &[
@@ -515,7 +514,7 @@ mod tests {
#[test]
fn parse_osc_max_params() {
- let params = std::iter::repeat(";").take(params::MAX_PARAMS + 1).collect::<String>();
+ let params = ";".repeat(params::MAX_PARAMS + 1);
let input = format!("\x1b]{}\x1b", &params[..]).into_bytes();
let mut dispatcher = Dispatcher::default();
let mut parser = Parser::new();
@@ -656,7 +655,7 @@ mod tests {
// This will build a list of repeating '1;'s
// The length is MAX_PARAMS - 1 because the last semicolon is interpreted
// as an implicit zero, making the total number of parameters MAX_PARAMS
- let params = std::iter::repeat("1;").take(params::MAX_PARAMS - 1).collect::<String>();
+ let params = "1;".repeat(params::MAX_PARAMS - 1);
let input = format!("\x1b[{}p", &params[..]).into_bytes();
let mut dispatcher = Dispatcher::default();
@@ -681,7 +680,7 @@ mod tests {
// This will build a list of repeating '1;'s
// The length is MAX_PARAMS because the last semicolon is interpreted
// as an implicit zero, making the total number of parameters MAX_PARAMS + 1
- let params = std::iter::repeat("1;").take(params::MAX_PARAMS).collect::<String>();
+ let params = "1;".repeat(params::MAX_PARAMS);
let input = format!("\x1b[{}p", &params[..]).into_bytes();
let mut dispatcher = Dispatcher::default();
@@ -796,7 +795,7 @@ mod tests {
#[test]
fn parse_dcs_max_params() {
- let params = std::iter::repeat("1;").take(params::MAX_PARAMS + 1).collect::<String>();
+ let params = "1;".repeat(params::MAX_PARAMS + 1);
let input = format!("\x1bP{}p", &params[..]).into_bytes();
let mut dispatcher = Dispatcher::default();
let mut parser = Parser::new();
diff --git a/utf8parse/src/lib.rs b/utf8parse/src/lib.rs
index 6168e2e..947a0aa 100644
--- a/utf8parse/src/lib.rs
+++ b/utf8parse/src/lib.rs
@@ -3,7 +3,7 @@
//! This module implements a table-driven UTF-8 parser which should
//! theoretically contain the minimal number of branches (1). The only branch is
//! on the `Action` returned from unpacking a transition.
-#![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use, clippy::wrong_pub_self_convention)]
+#![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use)]
#![cfg_attr(all(feature = "nightly", test), feature(test))]
#![no_std]
diff --git a/vte_generate_state_changes/src/lib.rs b/vte_generate_state_changes/src/lib.rs
index cae8f65..b016518 100644
--- a/vte_generate_state_changes/src/lib.rs
+++ b/vte_generate_state_changes/src/lib.rs
@@ -1,4 +1,4 @@
-#![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use, clippy::wrong_pub_self_convention)]
+#![deny(clippy::all, clippy::if_not_else, clippy::enum_glob_use)]
extern crate proc_macro;
@@ -153,10 +153,10 @@ fn next_usize(iter: &mut impl Iterator<Item = TokenTree>) -> usize {
match iter.next() {
Some(Literal(literal)) => {
let literal = literal.to_string();
- if literal.starts_with("0x") {
- usize::from_str_radix(&literal[2..], 16).unwrap()
+ if let Some(prefix) = literal.strip_prefix("0x") {
+ usize::from_str_radix(prefix, 16).unwrap()
} else {
- usize::from_str_radix(&literal, 10).unwrap()
+ literal.parse::<usize>().unwrap()
}
},
token => panic!("Expected literal, but got {:?}", token),