aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirkjan Ochtman <dirkjan@ochtman.nl>2023-05-27 01:06:15 +0200
committerGitHub <noreply@github.com>2023-05-26 23:06:15 +0000
commit624fd93aa77227138fd864d43fc9bdb84095de41 (patch)
tree713b3b1e5f8938f3c20d27da88e3a9e070754a31
parent5e209bdccb44d7fbf3911629b4b9e771d8298b23 (diff)
downloadr-alacritty-vte-624fd93aa77227138fd864d43fc9bdb84095de41.tar.gz
r-alacritty-vte-624fd93aa77227138fd864d43fc9bdb84095de41.tar.bz2
r-alacritty-vte-624fd93aa77227138fd864d43fc9bdb84095de41.zip
Bump rust-version to match actual MSRV
-rw-r--r--.builds/linux.yml7
-rw-r--r--Cargo.toml2
-rw-r--r--src/ansi.rs27
3 files changed, 11 insertions, 25 deletions
diff --git a/.builds/linux.yml b/.builds/linux.yml
index eadc34e..893e6a4 100644
--- a/.builds/linux.yml
+++ b/.builds/linux.yml
@@ -17,8 +17,9 @@ tasks:
$HOME/.cargo/bin/rustup toolchain install nightly -c rustfmt
cd vte
$HOME/.cargo/bin/cargo +nightly fmt -- --check
- - 1-62-1: |
- $HOME/.cargo/bin/rustup toolchain install --profile minimal 1.62.1
+ - msrv: |
cd vte
+ msrv=$(cat Cargo.toml | grep "rust-version" | sed 's/.*"\(.*\)".*/\1/')
+ $HOME/.cargo/bin/rustup toolchain install --profile minimal $msrv
rm Cargo.lock
- $HOME/.cargo/bin/cargo +1.62.1 test
+ $HOME/.cargo/bin/cargo +$msrv test
diff --git a/Cargo.toml b/Cargo.toml
index f7bc3da..766dffc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT"
version = "0.11.1"
name = "vte"
edition = "2021"
-rust-version = "1.56.0"
+rust-version = "1.62.1"
[dependencies]
vte_generate_state_changes = { version = "0.1.0", path = "vte_generate_state_changes" }
diff --git a/src/ansi.rs b/src/ansi.rs
index 2024164..1385802 100644
--- a/src/ansi.rs
+++ b/src/ansi.rs
@@ -678,9 +678,10 @@ pub struct CursorStyle {
}
/// Terminal cursor shape.
-#[derive(Debug, Eq, PartialEq, Copy, Clone, Hash)]
+#[derive(Debug, Default, Eq, PartialEq, Copy, Clone, Hash)]
pub enum CursorShape {
/// Cursor is a block like `▒`.
+ #[default]
Block,
/// Cursor is an underscore like `_`.
@@ -696,12 +697,6 @@ pub enum CursorShape {
Hidden,
}
-impl Default for CursorShape {
- fn default() -> CursorShape {
- CursorShape::Block
- }
-}
-
/// Terminal modes.
#[derive(Debug, Eq, PartialEq)]
pub enum Mode {
@@ -1023,34 +1018,24 @@ pub enum Attr {
}
/// Identifiers which can be assigned to a graphic character set.
-#[derive(Clone, Copy, Debug, Eq, PartialEq)]
+#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum CharsetIndex {
/// Default set, is designated as ASCII at startup.
+ #[default]
G0,
G1,
G2,
G3,
}
-impl Default for CharsetIndex {
- fn default() -> Self {
- CharsetIndex::G0
- }
-}
-
/// Standard or common character sets which can be designated as G0-G3.
-#[derive(Clone, Copy, Debug, Eq, PartialEq)]
+#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum StandardCharset {
+ #[default]
Ascii,
SpecialCharacterAndLineDrawing,
}
-impl Default for StandardCharset {
- fn default() -> Self {
- StandardCharset::Ascii
- }
-}
-
impl StandardCharset {
/// Switch/Map character to the active charset. Ascii is the common case and
/// for that we want to do as little as possible.