Skip to content

Commit

Permalink
feat: change piece number from int32 to uint32 (#198)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Nov 1, 2023
1 parent 92ad2be commit cfe9d4a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dragonfly-api"
version = "2.0.34"
version = "2.0.35"
authors = ["Gaius <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
Expand Down
6 changes: 3 additions & 3 deletions pkg/apis/common/v2/common.pb.go

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

2 changes: 1 addition & 1 deletion pkg/apis/common/v2/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ message Range {
// Piece represents information of piece.
message Piece {
// Piece number.
int32 number = 1 [(validate.rules).int32.gte = 0];
uint32 number = 1 [(validate.rules).uint32.gte = 0];
// Parent peer id.
optional string parent_id = 2 [(validate.rules).string = {min_len: 1, ignore_empty: true}];
// Piece offset.
Expand Down
2 changes: 1 addition & 1 deletion proto/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ message Range {
// Piece represents information of piece.
message Piece {
// Piece number.
int32 number = 1;
uint32 number = 1;
// Parent peer id.
optional string parent_id = 2;
// Piece offset.
Expand Down
4 changes: 2 additions & 2 deletions src/common.v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,8 @@ pub struct Range {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Piece {
/// Piece number.
#[prost(int32, tag = "1")]
pub number: i32,
#[prost(uint32, tag = "1")]
pub number: u32,
/// Parent peer id.
#[prost(string, optional, tag = "2")]
pub parent_id: ::core::option::Option<::prost::alloc::string::String>,
Expand Down
Binary file modified src/descriptor.bin
Binary file not shown.

0 comments on commit cfe9d4a

Please sign in to comment.