diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c04d57ef2..7b26868b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: env: PROTOC_VERSION: '3.20.3' - clippy_rust_version: '1.79' + clippy_rust_version: '1.80' jobs: # Depends on all actions that are required for a "successful" CI run. diff --git a/Cargo.toml b/Cargo.toml index 56855e359..5b2a48636 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ authors = [ ] license = "Apache-2.0" repository = "https://github.com/tokio-rs/prost" -rust-version = "1.70" +rust-version = "1.80" edition = "2021" [profile.bench] diff --git a/prost-build/Cargo.toml b/prost-build/Cargo.toml index 0dc342cbc..6428153bf 100644 --- a/prost-build/Cargo.toml +++ b/prost-build/Cargo.toml @@ -24,7 +24,6 @@ petgraph = { version = "0.6", default-features = false } prost = { version = "0.13.1", path = "../prost", default-features = false } prost-types = { version = "0.13.1", path = "../prost-types", default-features = false } tempfile = "3" -once_cell = "1.17.1" regex = { version = "1.8.1", default-features = false, features = ["std", "unicode-bool"] } # feature: format diff --git a/prost-build/src/ast.rs b/prost-build/src/ast.rs index 9a6a0de99..07c6394ad 100644 --- a/prost-build/src/ast.rs +++ b/prost-build/src/ast.rs @@ -1,8 +1,8 @@ -use once_cell::sync::Lazy; use prost_types::source_code_info::Location; #[cfg(feature = "cleanup-markdown")] use pulldown_cmark::{CodeBlockKind, Event, Options, Parser, Tag}; use regex::Regex; +use std::sync::LazyLock; /// Comments on a Protobuf item. #[derive(Debug, Default, Clone)] @@ -110,9 +110,10 @@ impl Comments { /// - escape urls as /// - escape `[` & `]` if not already escaped and not followed by a parenthesis or bracket fn sanitize_line(line: &str) -> String { - static RULE_URL: Lazy = Lazy::new(|| Regex::new(r"https?://[^\s)]+").unwrap()); - static RULE_BRACKETS: Lazy = - Lazy::new(|| Regex::new(r"(^|[^\]\\])\[(([^\]]*[^\\])?)\]([^(\[]|$)").unwrap()); + static RULE_URL: LazyLock = + LazyLock::new(|| Regex::new(r"https?://[^\s)]+").unwrap()); + static RULE_BRACKETS: LazyLock = + LazyLock::new(|| Regex::new(r"(^|[^\]\\])\[(([^\]]*[^\\])?)\]([^(\[]|$)").unwrap()); let mut s = RULE_URL.replace_all(line, r"<$0>").to_string(); s = RULE_BRACKETS.replace_all(&s, r"$1\[$2\]$4").to_string();