Skip to content

Commit

Permalink
feat: update to rustc-hash 2
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWhiteWu committed Jun 24, 2024
1 parent 89ea743 commit be49318
Show file tree
Hide file tree
Showing 19 changed files with 15,921 additions and 15,915 deletions.
48 changes: 27 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pilota-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pilota-build"
version = "0.11.11"
version = "0.11.12"
edition = "2021"
description = "Compile thrift and protobuf idl into rust code at compile-time."
documentation = "https://docs.rs/pilota-build"
Expand Down Expand Up @@ -32,7 +32,7 @@ phf = { version = "0.11", features = ["macros"] }
proc-macro2 = "1"
quote = "1"
rayon = "1"
rustc-hash = "1"
rustc-hash = "2"
salsa = { version = "0.17.0-pre.2" }
scoped-tls = "1"
serde = { version = "1", features = ["derive"] }
Expand Down
136 changes: 68 additions & 68 deletions pilota-build/test_data/plugin/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,74 @@ pub mod serde {
+ __protocol.struct_end_len()
}
}
#[derive(
PartialOrd,
Hash,
Eq,
Ord,
Debug,
Default,
::pilota::serde::Serialize,
::pilota::serde::Deserialize,
)]
#[serde(rename = "BB")]
#[derive(Clone, PartialEq)]
pub struct B(pub i32);

impl ::std::ops::Deref for B {
type Target = i32;

fn deref(&self) -> &Self::Target {
&self.0
}
}

impl From<i32> for B {
fn from(v: i32) -> Self {
Self(v)
}
}

impl ::pilota::thrift::Message for B {
fn encode<T: ::pilota::thrift::TOutputProtocol>(
&self,
__protocol: &mut T,
) -> ::std::result::Result<(), ::pilota::thrift::ThriftException> {
#[allow(unused_imports)]
use ::pilota::thrift::TOutputProtocolExt;
__protocol.write_i32(*(&**self))?;
::std::result::Result::Ok(())
}

fn decode<T: ::pilota::thrift::TInputProtocol>(
__protocol: &mut T,
) -> ::std::result::Result<Self, ::pilota::thrift::ThriftException> {
#[allow(unused_imports)]
use ::pilota::{thrift::TLengthProtocolExt, Buf};
::std::result::Result::Ok(B(__protocol.read_i32()?))
}

fn decode_async<'a, T: ::pilota::thrift::TAsyncInputProtocol>(
__protocol: &'a mut T,
) -> ::std::pin::Pin<
::std::boxed::Box<
dyn ::std::future::Future<
Output = ::std::result::Result<Self, ::pilota::thrift::ThriftException>,
> + Send
+ 'a,
>,
> {
::std::boxed::Box::pin(async move {
::std::result::Result::Ok(B(__protocol.read_i32().await?))
})
}

fn size<T: ::pilota::thrift::TLengthProtocol>(&self, __protocol: &mut T) -> usize {
#[allow(unused_imports)]
use ::pilota::thrift::TLengthProtocolExt;
__protocol.i32_len(*&**self)
}
}
#[derive(PartialOrd, Hash, Eq, Ord, Debug, ::pilota::derivative::Derivative)]
#[derivative(Default)]
#[derive(::pilota::serde::Serialize, ::pilota::serde::Deserialize)]
Expand Down Expand Up @@ -289,73 +357,5 @@ pub mod serde {
__protocol.i32_len(self.inner())
}
}
#[derive(
PartialOrd,
Hash,
Eq,
Ord,
Debug,
Default,
::pilota::serde::Serialize,
::pilota::serde::Deserialize,
)]
#[serde(rename = "BB")]
#[derive(Clone, PartialEq)]
pub struct B(pub i32);

impl ::std::ops::Deref for B {
type Target = i32;

fn deref(&self) -> &Self::Target {
&self.0
}
}

impl From<i32> for B {
fn from(v: i32) -> Self {
Self(v)
}
}

impl ::pilota::thrift::Message for B {
fn encode<T: ::pilota::thrift::TOutputProtocol>(
&self,
__protocol: &mut T,
) -> ::std::result::Result<(), ::pilota::thrift::ThriftException> {
#[allow(unused_imports)]
use ::pilota::thrift::TOutputProtocolExt;
__protocol.write_i32(*(&**self))?;
::std::result::Result::Ok(())
}

fn decode<T: ::pilota::thrift::TInputProtocol>(
__protocol: &mut T,
) -> ::std::result::Result<Self, ::pilota::thrift::ThriftException> {
#[allow(unused_imports)]
use ::pilota::{thrift::TLengthProtocolExt, Buf};
::std::result::Result::Ok(B(__protocol.read_i32()?))
}

fn decode_async<'a, T: ::pilota::thrift::TAsyncInputProtocol>(
__protocol: &'a mut T,
) -> ::std::pin::Pin<
::std::boxed::Box<
dyn ::std::future::Future<
Output = ::std::result::Result<Self, ::pilota::thrift::ThriftException>,
> + Send
+ 'a,
>,
> {
::std::boxed::Box::pin(async move {
::std::result::Result::Ok(B(__protocol.read_i32().await?))
})
}

fn size<T: ::pilota::thrift::TLengthProtocol>(&self, __protocol: &mut T) -> usize {
#[allow(unused_imports)]
use ::pilota::thrift::TLengthProtocolExt;
__protocol.i32_len(*&**self)
}
}
}
}
Loading

0 comments on commit be49318

Please sign in to comment.