diff --git a/Cargo.toml b/Cargo.toml index 76217f1..11aa483 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,11 +6,11 @@ members = [ "pbjson-types", ] -resolver = "2" +resolver = "3" [workspace.package] version = "0.8.0" -edition = "2021" +edition = "2024" license = "MIT" keywords = ["protobuf", "json", "serde"] categories = ["encoding"] diff --git a/pbjson-build/src/descriptor.rs b/pbjson-build/src/descriptor.rs index 37f9ddc..b74c3de 100644 --- a/pbjson-build/src/descriptor.rs +++ b/pbjson-build/src/descriptor.rs @@ -1,8 +1,8 @@ //! This module contains code to parse and extract the protobuf descriptor //! format for use by the rest of the codebase -use std::collections::btree_map::Entry; use std::collections::BTreeMap; +use std::collections::btree_map::Entry; use std::fmt::{Display, Formatter}; use std::io::{Error, ErrorKind, Result}; diff --git a/pbjson-build/src/generator/enumeration.rs b/pbjson-build/src/generator/enumeration.rs index fb74b43..3bae939 100644 --- a/pbjson-build/src/generator/enumeration.rs +++ b/pbjson-build/src/generator/enumeration.rs @@ -5,8 +5,8 @@ //! or its integer tag number, and should encode to the string representation use super::{ - write_deserialize_end, write_deserialize_start, write_serialize_end, write_serialize_start, - Indent, + Indent, write_deserialize_end, write_deserialize_start, write_serialize_end, + write_serialize_start, }; use crate::descriptor::{EnumDescriptor, TypePath}; use crate::generator::write_fields_array; diff --git a/pbjson-build/src/generator/message.rs b/pbjson-build/src/generator/message.rs index 467f095..0ecaa8d 100644 --- a/pbjson-build/src/generator/message.rs +++ b/pbjson-build/src/generator/message.rs @@ -26,8 +26,8 @@ use std::io::{Result, Write}; use crate::message::{Field, FieldModifier, FieldType, Message, OneOf, ScalarType}; use super::{ - write_deserialize_end, write_deserialize_start, write_serialize_end, write_serialize_start, - Indent, + Indent, write_deserialize_end, write_deserialize_start, write_serialize_end, + write_serialize_start, }; use crate::descriptor::TypePath; use crate::escape::escape_type; diff --git a/pbjson-build/src/message.rs b/pbjson-build/src/message.rs index d21406a..288d661 100644 --- a/pbjson-build/src/message.rs +++ b/pbjson-build/src/message.rs @@ -5,8 +5,8 @@ //! message that can be used by the code generation logic use prost_types::{ - field_descriptor_proto::{Label, Type}, FieldDescriptorProto, + field_descriptor_proto::{Label, Type}, }; use crate::descriptor::{Descriptor, DescriptorSet, MessageDescriptor, Syntax, TypeName, TypePath}; diff --git a/pbjson-types/src/duration.rs b/pbjson-types/src/duration.rs index d776ca2..5f952d4 100644 --- a/pbjson-types/src/duration.rs +++ b/pbjson-types/src/duration.rs @@ -1,6 +1,6 @@ use crate::Duration; -use serde::de::Visitor; use serde::Serialize; +use serde::de::Visitor; impl TryFrom for std::time::Duration { type Error = std::num::TryFromIntError; diff --git a/pbjson-types/src/timestamp.rs b/pbjson-types/src/timestamp.rs index a842e13..5ed6d61 100644 --- a/pbjson-types/src/timestamp.rs +++ b/pbjson-types/src/timestamp.rs @@ -1,7 +1,7 @@ use crate::Timestamp; use chrono::{DateTime, Utc}; -use serde::de::Visitor; use serde::Serialize; +use serde::de::Visitor; impl TryFrom for DateTime { type Error = &'static str; @@ -69,8 +69,8 @@ impl<'de> serde::Deserialize<'de> for Timestamp { mod tests { use super::*; use chrono::{FixedOffset, TimeZone}; - use serde::de::value::{BorrowedStrDeserializer, Error}; use serde::Deserialize; + use serde::de::value::{BorrowedStrDeserializer, Error}; #[test] fn test_date() { diff --git a/pbjson-types/src/value.rs b/pbjson-types/src/value.rs index c3fc87b..aa2e9b7 100644 --- a/pbjson-types/src/value.rs +++ b/pbjson-types/src/value.rs @@ -1,8 +1,9 @@ pub use crate::pb::google::protobuf::value::Kind; use serde::{ + Deserialize, Deserializer, Serialize, Serializer, de::{self, MapAccess, SeqAccess}, - ser, Deserialize, Deserializer, Serialize, Serializer, + ser, }; macro_rules! from { diff --git a/pbjson/src/lib.rs b/pbjson/src/lib.rs index 90de687..d70e869 100644 --- a/pbjson/src/lib.rs +++ b/pbjson/src/lib.rs @@ -22,11 +22,11 @@ pub mod private { /// Re-export base64 pub use base64; + use base64::Engine; use base64::engine::DecodePaddingMode; use base64::engine::{GeneralPurpose, GeneralPurposeConfig}; - use base64::Engine; - use serde::de::Visitor; use serde::Deserialize; + use serde::de::Visitor; use std::borrow::Cow; use std::str::FromStr;