From bf15470a37e0a2396e384dc85d1c61ab8f9028de Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Fri, 29 Jul 2022 14:29:25 -0400 Subject: [PATCH] Clean up edition move & clippy warnings --- prost-build/Cargo.toml | 3 ++- prost-build/src/lib.rs | 2 +- prost-derive/Cargo.toml | 3 ++- prost-types/Cargo.toml | 3 ++- prost-types/src/lib.rs | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/prost-build/Cargo.toml b/prost-build/Cargo.toml index c3692c72e..c348d5e35 100644 --- a/prost-build/Cargo.toml +++ b/prost-build/Cargo.toml @@ -10,7 +10,8 @@ repository = "https://github.com/tokio-rs/prost" documentation = "https://docs.rs/prost-build" readme = "README.md" description = "A Protocol Buffers implementation for the Rust Language." -edition = "2018" +edition = "2021" +rust-version = "1.56" [features] default = [] diff --git a/prost-build/src/lib.rs b/prost-build/src/lib.rs index bfcce592e..908a76a22 100644 --- a/prost-build/src/lib.rs +++ b/prost-build/src/lib.rs @@ -1,5 +1,5 @@ #![doc(html_root_url = "https://docs.rs/prost-build/0.10.1")] -#![allow(clippy::option_as_ref_deref)] +#![allow(clippy::option_as_ref_deref, clippy::format_push_string)] //! `prost-build` compiles `.proto` files into Rust. //! diff --git a/prost-derive/Cargo.toml b/prost-derive/Cargo.toml index 6e99e7cad..660439c63 100644 --- a/prost-derive/Cargo.toml +++ b/prost-derive/Cargo.toml @@ -10,7 +10,8 @@ repository = "https://github.com/tokio-rs/prost" documentation = "https://docs.rs/prost-derive" readme = "README.md" description = "A Protocol Buffers implementation for the Rust Language." -edition = "2018" +edition = "2021" +rust-version = "1.56" [lib] proc_macro = true diff --git a/prost-types/Cargo.toml b/prost-types/Cargo.toml index c718cd378..9862901c9 100644 --- a/prost-types/Cargo.toml +++ b/prost-types/Cargo.toml @@ -10,7 +10,8 @@ repository = "https://github.com/tokio-rs/prost" documentation = "https://docs.rs/prost-types" readme = "README.md" description = "A Protocol Buffers implementation for the Rust Language." -edition = "2018" +edition = "2021" +rust-version = "1.56" [lib] doctest = false diff --git a/prost-types/src/lib.rs b/prost-types/src/lib.rs index 223bd1aa9..dd3cbf050 100644 --- a/prost-types/src/lib.rs +++ b/prost-types/src/lib.rs @@ -372,7 +372,7 @@ impl TryFrom for std::time::SystemTime { timestamp .seconds .checked_neg() - .ok_or(TimestampError::OutOfSystemRange(timestamp.clone()))? + .ok_or_else(|| TimestampError::OutOfSystemRange(timestamp.clone()))? as u64, )) };