-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove trailing whitespace for generated code in split mode
- Loading branch information
Showing
18 changed files
with
230 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
syntax = "proto3"; | ||
|
||
package service; | ||
|
||
message EchoRequest { | ||
string message = 1; | ||
} | ||
|
||
message EchoResponse { | ||
string message = 1; | ||
} | ||
|
||
service Echo { | ||
rpc Echo(EchoRequest) returns (EchoResponse) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
pub mod service { | ||
#![allow(warnings, clippy::all)] | ||
|
||
pub mod service { | ||
include!("service/mod.rs"); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
pilota-build/test_data/protobuf_with_split/service/message_EchoRequest.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#[derive(PartialOrd, Hash, Eq, Ord, Debug, Default, Clone, PartialEq)] | ||
pub struct EchoRequest { | ||
pub message: ::pilota::FastStr, | ||
} | ||
impl ::pilota::prost::Message for EchoRequest { | ||
#[inline] | ||
fn encoded_len(&self) -> usize { | ||
0 + ::pilota::prost::encoding::faststr::encoded_len(1, &self.message) | ||
} | ||
|
||
#[allow(unused_variables)] | ||
fn encode_raw<B>(&self, buf: &mut B) | ||
where | ||
B: ::pilota::prost::bytes::BufMut, | ||
{ | ||
::pilota::prost::encoding::faststr::encode(1, &self.message, buf); | ||
} | ||
|
||
#[allow(unused_variables)] | ||
fn merge_field<B>( | ||
&mut self, | ||
tag: u32, | ||
wire_type: ::pilota::prost::encoding::WireType, | ||
buf: &mut B, | ||
ctx: ::pilota::prost::encoding::DecodeContext, | ||
) -> ::core::result::Result<(), ::pilota::prost::DecodeError> | ||
where | ||
B: ::pilota::prost::bytes::Buf, | ||
{ | ||
const STRUCT_NAME: &'static str = stringify!(EchoRequest); | ||
match tag { | ||
1 => { | ||
let mut _inner_pilota_value = &mut self.message; | ||
::pilota::prost::encoding::faststr::merge(wire_type, _inner_pilota_value, buf, ctx) | ||
.map_err(|mut error| { | ||
error.push(STRUCT_NAME, stringify!(message)); | ||
error | ||
}) | ||
} | ||
_ => ::pilota::prost::encoding::skip_field(wire_type, tag, buf, ctx), | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
pilota-build/test_data/protobuf_with_split/service/message_EchoResponse.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#[derive(PartialOrd, Hash, Eq, Ord, Debug, Default, Clone, PartialEq)] | ||
pub struct EchoResponse { | ||
pub message: ::pilota::FastStr, | ||
} | ||
impl ::pilota::prost::Message for EchoResponse { | ||
#[inline] | ||
fn encoded_len(&self) -> usize { | ||
0 + ::pilota::prost::encoding::faststr::encoded_len(1, &self.message) | ||
} | ||
|
||
#[allow(unused_variables)] | ||
fn encode_raw<B>(&self, buf: &mut B) | ||
where | ||
B: ::pilota::prost::bytes::BufMut, | ||
{ | ||
::pilota::prost::encoding::faststr::encode(1, &self.message, buf); | ||
} | ||
|
||
#[allow(unused_variables)] | ||
fn merge_field<B>( | ||
&mut self, | ||
tag: u32, | ||
wire_type: ::pilota::prost::encoding::WireType, | ||
buf: &mut B, | ||
ctx: ::pilota::prost::encoding::DecodeContext, | ||
) -> ::core::result::Result<(), ::pilota::prost::DecodeError> | ||
where | ||
B: ::pilota::prost::bytes::Buf, | ||
{ | ||
const STRUCT_NAME: &'static str = stringify!(EchoResponse); | ||
match tag { | ||
1 => { | ||
let mut _inner_pilota_value = &mut self.message; | ||
::pilota::prost::encoding::faststr::merge(wire_type, _inner_pilota_value, buf, ctx) | ||
.map_err(|mut error| { | ||
error.push(STRUCT_NAME, stringify!(message)); | ||
error | ||
}) | ||
} | ||
_ => ::pilota::prost::encoding::skip_field(wire_type, tag, buf, ctx), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
include!("message_EchoRequest.rs"); | ||
include!("service_Echo.rs"); | ||
include!("message_EchoResponse.rs"); |
2 changes: 2 additions & 0 deletions
2
pilota-build/test_data/protobuf_with_split/service/service_Echo.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
pub trait Echo {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
[workspace] | ||
members = [ | ||
"article", | ||
"author", "common", | ||
"author", | ||
"common", | ||
"image", | ||
] | ||
|
||
|
3 changes: 2 additions & 1 deletion
3
pilota-build/test_data/thrift_workspace_with_split/output/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
[workspace] | ||
members = [ | ||
"article", | ||
"author", "common", | ||
"author", | ||
"common", | ||
"image", | ||
] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.