Skip to content

Commit

Permalink
update rust 1.63
Browse files Browse the repository at this point in the history
fix lint error
  • Loading branch information
uvd authored and davidiw committed Aug 31, 2022
1 parent ccccfe3 commit 6d56434
Show file tree
Hide file tree
Showing 119 changed files with 393 additions and 371 deletions.
2 changes: 1 addition & 1 deletion api/src/accept_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use aptos_api_types::mime_types::BCS;
use poem::{web::Accept, FromRequest, Request, RequestBody, Result};

#[derive(PartialEq, Debug)]
#[derive(PartialEq, Eq, Debug)]
pub enum AcceptType {
Json,
Bcs,
Expand Down
2 changes: 1 addition & 1 deletion api/src/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct BasicApi {
pub context: Arc<Context>,
}

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize, Object)]
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize, Object)]
pub struct HealthCheckSuccess {
message: String,
}
Expand Down
5 changes: 2 additions & 3 deletions api/test-context/src/test_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,10 @@ impl TestContext {
&self,
poem_address: SocketAddr,
) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
let proxy = warp::path!("v1" / ..).and(reverse_proxy_filter(
warp::path!("v1" / ..).and(reverse_proxy_filter(
"v1".to_string(),
format!("http://{}/v1", poem_address),
));
proxy
))
}

pub async fn execute(&self, req: warp::test::RequestBuilder) -> Value {
Expand Down
2 changes: 1 addition & 1 deletion api/types/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use aptos_types::account_config::AccountResource;
use poem_openapi::Object;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Object)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct AccountData {
pub sequence_number: U64,
pub authentication_key: HexEncodedBytes,
Expand Down
2 changes: 1 addition & 1 deletion api/types/src/event_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer};
use std::{fmt, str::FromStr};

#[derive(Clone, Debug, PartialEq, Copy)]
#[derive(Clone, Debug, PartialEq, Eq, Copy)]
pub struct EventKey(pub aptos_types::event::EventKey);

impl From<aptos_types::event::EventKey> for EventKey {
Expand Down
2 changes: 1 addition & 1 deletion api/types/src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize};

/// The struct holding all data returned to the client by the
/// index endpoint (i.e., GET "/").
#[derive(Clone, Debug, Deserialize, PartialEq, PoemObject, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, PoemObject, Serialize)]
pub struct IndexResponse {
pub chain_id: u8,
pub epoch: U64,
Expand Down
2 changes: 1 addition & 1 deletion api/types/src/ledger_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use poem_openapi::Object as PoemObject;

use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, PoemObject)]
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, PoemObject)]
pub struct LedgerInfo {
pub chain_id: u8,
pub epoch: U64,
Expand Down
34 changes: 17 additions & 17 deletions api/types/src/move_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use std::{
str::FromStr,
};

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Object)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveResource {
#[serde(rename = "type")]
#[oai(rename = "type")]
Expand Down Expand Up @@ -112,7 +112,7 @@ impl FromStr for U64 {
}
}

#[derive(Clone, Debug, Default, PartialEq, Copy)]
#[derive(Clone, Debug, Default, PartialEq, Eq, Copy)]
pub struct U128(pub u128);

impl U128 {
Expand Down Expand Up @@ -169,7 +169,7 @@ impl FromStr for U128 {
}
}

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct HexEncodedBytes(pub Vec<u8>);

impl HexEncodedBytes {
Expand Down Expand Up @@ -255,7 +255,7 @@ impl HexEncodedBytes {
}
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct MoveStructValue(pub BTreeMap<IdentifierWrapper, serde_json::Value>);

impl TryFrom<AnnotatedMoveStruct> for MoveStructValue {
Expand Down Expand Up @@ -358,7 +358,7 @@ impl Serialize for MoveValue {
}
}

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MoveStructTag {
pub address: Address,
pub module: IdentifierWrapper,
Expand Down Expand Up @@ -448,7 +448,7 @@ impl TryFrom<MoveStructTag> for StructTag {
}
}

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum MoveType {
Bool,
U8,
Expand Down Expand Up @@ -618,7 +618,7 @@ impl TryFrom<MoveType> for TypeTag {
}
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Object)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveModule {
pub address: Address,
pub name: IdentifierWrapper,
Expand Down Expand Up @@ -719,7 +719,7 @@ impl<'de> Deserialize<'de> for MoveModuleId {
}
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Object)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveStruct {
pub name: IdentifierWrapper,
pub is_native: bool,
Expand All @@ -731,7 +731,7 @@ pub struct MoveStruct {
// TODO: Consider finding a way to derive NewType here instead of using the
// custom macro, since some of the enum type information (such as the
// variants) is currently being lost.
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MoveAbility(pub Ability);

impl From<Ability> for MoveAbility {
Expand Down Expand Up @@ -788,7 +788,7 @@ impl<'de> Deserialize<'de> for MoveAbility {
}
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Object)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveStructGenericTypeParam {
pub constraints: Vec<MoveAbility>,
#[oai(skip)]
Expand All @@ -808,15 +808,15 @@ impl From<&StructTypeParameter> for MoveStructGenericTypeParam {
}
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Object)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveStructField {
pub name: IdentifierWrapper,
#[serde(rename = "type")]
#[oai(rename = "type")]
pub typ: MoveType,
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Object)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveFunction {
pub name: IdentifierWrapper,
pub visibility: MoveFunctionVisibility,
Expand Down Expand Up @@ -850,7 +850,7 @@ impl From<&CompiledScript> for MoveFunction {
}
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Enum)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Enum)]
#[serde(rename_all = "snake_case")]
#[oai(rename_all = "snake_case")]
pub enum MoveFunctionVisibility {
Expand Down Expand Up @@ -879,7 +879,7 @@ impl From<MoveFunctionVisibility> for Visibility {
}
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Object)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveFunctionGenericTypeParam {
pub constraints: Vec<MoveAbility>,
}
Expand All @@ -892,7 +892,7 @@ impl From<&AbilitySet> for MoveFunctionGenericTypeParam {
}
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Object)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveModuleBytecode {
pub bytecode: HexEncodedBytes,
// We don't need deserialize MoveModule as it should be serialized
Expand Down Expand Up @@ -928,7 +928,7 @@ impl From<Module> for MoveModuleBytecode {
}
}

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Object)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct MoveScriptBytecode {
pub bytecode: HexEncodedBytes,
// We don't need deserialize MoveModule as it should be serialized
Expand Down Expand Up @@ -958,7 +958,7 @@ impl MoveScriptBytecode {
}
}

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct EntryFunctionId {
pub module: MoveModuleId,
pub name: IdentifierWrapper,
Expand Down
2 changes: 1 addition & 1 deletion api/types/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use poem_openapi::Object;
use serde::{Deserialize, Serialize};
use serde_json::Value;

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Object)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Object)]
pub struct TableItemRequest {
pub key_type: MoveType,
pub value_type: MoveType,
Expand Down
Loading

0 comments on commit 6d56434

Please sign in to comment.