diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 00acc62..c5c2bce 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@master - uses: actions-rs/toolchain@v1 with: - toolchain: "1.64" + toolchain: "1.70" profile: minimal override: true - name: Run check diff --git a/CHANGELOG.md b/CHANGELOG.md index 208d901..e8e26c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - \[Rust\]: Added `#[allow(dead_code)]` to the root of the generated rust code [#204](https://github.com/planus-org/planus/pull/204) - Added the option `ignore_docstring_errors` to the app. [#216](https://github.com/planus-org/planus/pull/216) +- Get rid of dependency on `atty` and bump the Minimum Support Rust Version (MSRV) to 1.70.0. [#220](https://github.com/planus-org/planus/pull/220) ### Fixed diff --git a/Cargo.lock b/Cargo.lock index edabb69..1bb5b9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -164,17 +164,6 @@ dependencies = [ "toml", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -721,15 +710,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.3" @@ -774,7 +754,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi", "rustix", "windows-sys 0.48.0", ] @@ -1155,7 +1135,6 @@ dependencies = [ name = "planus-translation" version = "0.4.0" dependencies = [ - "atty", "bitflags 2.4.1", "codespan", "codespan-reporting", diff --git a/Cargo.toml b/Cargo.toml index d876c63..75fd25e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,5 +7,5 @@ resolver = "2" version = "0.4.0" license = "MIT/Apache-2.0" repository = "https://github.com/planus-org/planus" -rust-version = "1.64" +rust-version = "1.70" edition = "2021" diff --git a/README.md b/README.md index e5c285d..31e2ea0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Planus – alternative flatbuffer implementation [![Build Status](https://github.com/planus-org/planus/actions/workflows/rust.yml/badge.svg?branch=main)](https://github.com/planus-org/planus/actions/workflows/rust.yml) -![Rustc Version 1.64+](https://img.shields.io/badge/rustc-1.64+-lightgray.svg) +![Rustc Version 1.70+](https://img.shields.io/badge/rustc-1.70+-lightgray.svg) [![License](https://img.shields.io/crates/l/planus)](https://crates.io/crates/planus) [![Crates.io](https://img.shields.io/crates/v/planus)](https://crates.io/crates/planus) [![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/planus) @@ -99,7 +99,7 @@ Things we will probably never support: ## Minimum Supported Rust Version (MSRV) -Our current Minimum Supported Rust Version is 1.64.0. When adding features, we will follow these guidelines: +Our current Minimum Supported Rust Version is 1.70.0. When adding features, we will follow these guidelines: - We will aim to support the latest five minor Rust versions. This gives you a 6 month window to upgrade your compiler. - Any change to the MSRV will be accompanied with a minor version bump diff --git a/crates/planus-translation/Cargo.toml b/crates/planus-translation/Cargo.toml index 3535bb2..f24ba4f 100644 --- a/crates/planus-translation/Cargo.toml +++ b/crates/planus-translation/Cargo.toml @@ -12,7 +12,6 @@ description = "Internal translation library for planus." [dependencies] planus-lexer = { version = "0.4.0", path = "../planus-lexer" } planus-types = { version = "0.4.0", path = "../planus-types" } -atty = "0.2.14" bitflags = "2.3.1" codespan = "0.11.1" codespan-reporting = "0.11.1" diff --git a/crates/planus-translation/src/ctx.rs b/crates/planus-translation/src/ctx.rs index 524a5be..7499745 100644 --- a/crates/planus-translation/src/ctx.rs +++ b/crates/planus-translation/src/ctx.rs @@ -1,5 +1,6 @@ use std::{ cell::{Cell, RefCell}, + io::IsTerminal, path::{Path, PathBuf}, sync::RwLock, }; @@ -37,7 +38,7 @@ pub struct Ctx { impl Default for Ctx { fn default() -> Self { - let color_choice = if atty::is(atty::Stream::Stderr) { + let color_choice = if std::io::stderr().is_terminal() { ColorChoice::Auto } else { ColorChoice::Never