From 8e004ee5cce10af4312c3a129f2fecc4e62ab357 Mon Sep 17 00:00:00 2001 From: Gaius Date: Mon, 20 Nov 2023 20:30:41 +0800 Subject: [PATCH] feat: change piece number to uint32 (#221) Signed-off-by: Gaius --- Cargo.toml | 2 +- proto/common.proto | 2 +- src/common.v2.rs | 4 ++-- src/descriptor.bin | Bin 76895 -> 76895 bytes 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3afdc7f..9464129 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dragonfly-api" -version = "2.0.55" +version = "2.0.56" authors = ["Gaius "] edition = "2021" license = "Apache-2.0" diff --git a/proto/common.proto b/proto/common.proto index dffa14f..d2ad2c8 100644 --- a/proto/common.proto +++ b/proto/common.proto @@ -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. diff --git a/src/common.v2.rs b/src/common.v2.rs index cd7aa38..268861d 100644 --- a/src/common.v2.rs +++ b/src/common.v2.rs @@ -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>, diff --git a/src/descriptor.bin b/src/descriptor.bin index e870c7213be3ad7d9dae991f289ebc63dc7cfa91..45c24238499e3346c758a9bbc62147f84de6119e 100644 GIT binary patch delta 59 zcmcbAgXR7WmJN5U8F@F~vtDG*C^EURSYDoki