Skip to content

Commit

Permalink
Address clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kespinola committed Dec 30, 2024
1 parent c612f8f commit 7301267
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 91 deletions.
2 changes: 1 addition & 1 deletion digital_asset_types/src/dapi/change_logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ fn build_asset_proof(
let mut final_node_list = vec![SimpleChangeLog::default(); req_indexes.len()];
for node in required_nodes.iter() {
if node.level < final_node_list.len().try_into().unwrap() {
final_node_list[node.level as usize] = node.to_owned();
node.clone_into(&mut final_node_list[node.level as usize])
}
}
for (i, (n, nin)) in final_node_list
Expand Down
6 changes: 1 addition & 5 deletions digital_asset_types/tests/common.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use blockbuster::token_metadata::types::{Collection, Creator, TokenStandard, Uses};
use blockbuster::token_metadata::types::{Creator, TokenStandard};
use digital_asset_types::dao::sea_orm_active_enums::{
SpecificationAssetClass, SpecificationVersions,
};
Expand Down Expand Up @@ -30,10 +30,6 @@ pub struct MockMetadataArgs {
pub edition_nonce: Option<u8>,
/// Since we cannot easily change Metadata, we add the new DataV2 fields here at the end.
pub token_standard: Option<TokenStandard>,
/// Collection
pub collection: Option<Collection>,
/// Uses
pub uses: Option<Uses>,
pub creators: Vec<Creator>,
}

Expand Down
2 changes: 0 additions & 2 deletions digital_asset_types/tests/get_asset_by_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ async fn get_asset_by_id() -> Result<(), DbErr> {
is_mutable: true,
edition_nonce: None,
token_standard: Some(TokenStandard::NonFungible),
collection: None,
uses: None,
creators: vec![Creator {
address: creator_1,
share: 100,
Expand Down
6 changes: 0 additions & 6 deletions digital_asset_types/tests/get_assets_by_authority.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ async fn get_assets_by_owner() -> Result<(), DbErr> {
primary_sale_happened: true,
is_mutable: true,
edition_nonce: None,
collection: None,
uses: None,
token_standard: Some(TokenStandard::NonFungible),
creators: vec![Creator {
address: creator_1,
Expand Down Expand Up @@ -90,8 +88,6 @@ async fn get_assets_by_owner() -> Result<(), DbErr> {
is_mutable: true,
edition_nonce: None,
token_standard: Some(TokenStandard::NonFungible),
collection: None,
uses: None,
creators: vec![Creator {
address: creator_2,
share: 100,
Expand Down Expand Up @@ -142,8 +138,6 @@ async fn get_assets_by_owner() -> Result<(), DbErr> {
is_mutable: true,
edition_nonce: None,
token_standard: Some(TokenStandard::NonFungible),
collection: None,
uses: None,
creators: vec![
Creator {
address: creator_2,
Expand Down
6 changes: 0 additions & 6 deletions digital_asset_types/tests/get_assets_by_creator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ async fn get_assets_by_creator() -> Result<(), DbErr> {
is_mutable: true,
edition_nonce: None,
token_standard: Some(TokenStandard::NonFungible),
collection: None,
uses: None,
creators: vec![Creator {
address: creator_1,
share: 100,
Expand Down Expand Up @@ -93,8 +91,6 @@ async fn get_assets_by_creator() -> Result<(), DbErr> {
is_mutable: true,
edition_nonce: None,
token_standard: Some(TokenStandard::NonFungible),
collection: None,
uses: None,
creators: vec![Creator {
address: creator_2,
share: 100,
Expand Down Expand Up @@ -145,8 +141,6 @@ async fn get_assets_by_creator() -> Result<(), DbErr> {
is_mutable: true,
edition_nonce: None,
token_standard: Some(TokenStandard::NonFungible),
collection: None,
uses: None,
creators: vec![
Creator {
address: creator_2,
Expand Down
6 changes: 0 additions & 6 deletions digital_asset_types/tests/get_assets_by_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ async fn get_assets_by_group() -> Result<(), DbErr> {
is_mutable: true,
edition_nonce: None,
token_standard: Some(TokenStandard::NonFungible),
collection: None,
uses: None,
creators: vec![Creator {
address: creator_1,
share: 100,
Expand Down Expand Up @@ -95,8 +93,6 @@ async fn get_assets_by_group() -> Result<(), DbErr> {
is_mutable: true,
edition_nonce: None,
token_standard: Some(TokenStandard::NonFungible),
collection: None,
uses: None,
creators: vec![Creator {
address: creator_2,
share: 100,
Expand Down Expand Up @@ -149,8 +145,6 @@ async fn get_assets_by_group() -> Result<(), DbErr> {
is_mutable: true,
edition_nonce: None,
token_standard: Some(TokenStandard::NonFungible),
collection: None,
uses: None,
creators: vec![
Creator {
address: creator_2,
Expand Down
6 changes: 0 additions & 6 deletions digital_asset_types/tests/get_assets_by_owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ async fn get_assets_by_owner() -> Result<(), DbErr> {
primary_sale_happened: true,
is_mutable: true,
edition_nonce: None,
collection: None,
uses: None,
token_standard: Some(TokenStandard::NonFungible),
creators: vec![Creator {
address: creator_1,
Expand Down Expand Up @@ -90,8 +88,6 @@ async fn get_assets_by_owner() -> Result<(), DbErr> {
is_mutable: true,
edition_nonce: None,
token_standard: Some(TokenStandard::NonFungible),
collection: None,
uses: None,
creators: vec![Creator {
address: creator_2,
share: 100,
Expand Down Expand Up @@ -142,8 +138,6 @@ async fn get_assets_by_owner() -> Result<(), DbErr> {
is_mutable: true,
edition_nonce: None,
token_standard: Some(TokenStandard::NonFungible),
collection: None,
uses: None,
creators: vec![
Creator {
address: creator_2,
Expand Down
58 changes: 0 additions & 58 deletions grpc-ingest/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,6 @@ impl ConfigIngestStream {
}
}

#[derive(Debug, Clone, Deserialize, Default)]
#[serde(default)]
pub struct ConfigTopograph {
#[serde(default = "ConfigTopograph::default_num_threads")]
pub num_threads: usize,
}

impl ConfigTopograph {
pub const fn default_num_threads() -> usize {
5
}
}

#[derive(Debug, Clone, Default, Deserialize)]
#[serde(default)]
pub struct ConfigPrometheus {
Expand Down Expand Up @@ -293,16 +280,6 @@ impl ConfigPostgres {
#[derive(Debug, Clone, Default, Deserialize)]
pub struct ConfigIngesterDownloadMetadata {
pub stream: ConfigIngestStream,
#[serde(
default = "ConfigIngesterDownloadMetadata::default_num_threads",
deserialize_with = "deserialize_usize_str"
)]
pub num_threads: usize,
#[serde(
default = "ConfigIngesterDownloadMetadata::default_max_attempts",
deserialize_with = "deserialize_usize_str"
)]
pub max_attempts: usize,
#[serde(
default = "ConfigIngesterDownloadMetadata::default_request_timeout",
deserialize_with = "deserialize_duration_str",
Expand All @@ -314,40 +291,13 @@ pub struct ConfigIngesterDownloadMetadata {
deserialize_with = "deserialize_usize_str"
)]
pub stream_maxlen: usize,
#[serde(
default = "ConfigIngesterDownloadMetadata::default_stream_max_size",
deserialize_with = "deserialize_usize_str"
)]
pub pipeline_max_size: usize,
#[serde(
default = "ConfigIngesterDownloadMetadata::default_pipeline_max_idle",
deserialize_with = "deserialize_duration_str",
rename = "pipeline_max_idle_ms"
)]
pub pipeline_max_idle: Duration,
}

impl ConfigIngesterDownloadMetadata {
pub const fn default_num_threads() -> usize {
2
}

pub const fn default_pipeline_max_idle() -> Duration {
Duration::from_millis(10)
}

pub const fn default_stream_max_size() -> usize {
10
}

pub const fn default_stream_maxlen() -> usize {
10_000_000
}

pub const fn default_max_attempts() -> usize {
3
}

pub const fn default_request_timeout() -> Duration {
Duration::from_millis(3_000)
}
Expand All @@ -362,11 +312,6 @@ pub struct ConfigMonitor {

#[derive(Debug, Clone, Deserialize)]
pub struct ConfigBubblegumVerify {
#[serde(
default = "ConfigBubblegumVerify::default_report_interval",
deserialize_with = "deserialize_duration_str"
)]
pub report_interval: Duration,
#[serde(default)]
pub only_trees: Option<Vec<String>>,
#[serde(
Expand All @@ -377,9 +322,6 @@ pub struct ConfigBubblegumVerify {
}

impl ConfigBubblegumVerify {
pub const fn default_report_interval() -> Duration {
Duration::from_millis(5 * 60 * 1000)
}
pub const fn default_max_concurrency() -> usize {
20
}
Expand Down
2 changes: 1 addition & 1 deletion program_transformers/src/bubblegum/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ where
pub async fn upsert_asset_creators<T>(
txn: &T,
id: Vec<u8>,
creators: &Vec<Creator>,
creators: &[Creator],
slot_updated: i64,
seq: i64,
) -> ProgramTransformerResult<()>
Expand Down

0 comments on commit 7301267

Please sign in to comment.