Skip to content

Commit 9884f04

Browse files
authored
doc length (#49)
1 parent b55f725 commit 9884f04

File tree

7 files changed

+25
-14
lines changed

7 files changed

+25
-14
lines changed

rust/sdk-examples/src/config/processor_config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use serde::{Deserialize, Serialize};
22

3+
#[allow(clippy::too_long_first_doc_paragraph)]
34
/// This enum captures the configs for all the different processors that are defined.
45
/// The configs for each processor should only contain configuration specific to that
56
/// processor. For configuration that is common to all processors, put it in

rust/sdk-examples/src/utils/database.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("src/db/postgres/mi
3434
pub const DEFAULT_MAX_POOL_SIZE: u32 = 150;
3535

3636
#[derive(QueryId)]
37+
#[allow(clippy::too_long_first_doc_paragraph)]
3738
/// Using this will append a where clause at the end of the string upsert function, e.g.
3839
/// INSERT INTO ... ON CONFLICT DO UPDATE SET ... WHERE "transaction_version" = excluded."transaction_version"
3940
/// This is needed when we want to maintain a table with only the latest state
@@ -195,6 +196,7 @@ where
195196
})
196197
}
197198

199+
#[allow(clippy::too_long_first_doc_paragraph)]
198200
/// Returns the entry for the config hashmap, or the default field count for the insert
199201
/// Given diesel has a limit of how many parameters can be inserted in a single operation (u16::MAX),
200202
/// we default to chunk an array of items based on how many columns are in the table.

rust/sdk/src/traits/processable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::{
55
use anyhow::Result;
66
use async_trait::async_trait;
77

8-
/// A trait to convince the compiler that different step types are mutually exclusive
8+
/// Trait to convince the compiler that different step types are mutually exclusive
99
pub trait RunnableStepType {}
1010

1111
// This is a dummy implementation for the unit type

rust/sdk/src/traits/runnable_step.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ where
99
Input: Send + 'static,
1010
Output: Send + 'static,
1111
{
12+
#[allow(clippy::too_long_first_doc_paragraph)]
1213
/// Runs the step, forever, with the given input receiver and returns the output receiver and the join handle.
1314
fn spawn(
1415
self,
@@ -62,6 +63,7 @@ where
6263
}
6364
}
6465

66+
#[allow(clippy::too_long_first_doc_paragraph)]
6567
/// This should only be used for the inputless first step to keep the async sender in scope so the channel stays alive.
6668
pub fn add_input_sender(
6769
mut self,

rust/sdk/src/types/transaction_context.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
use aptos_indexer_transaction_stream::utils::timestamp_to_unixtime;
22

3-
/// TransactionContext is a struct that holds data processed from a set of transactions
4-
/// and includes metadata about the transactions that the data is associated with.
5-
/// The metadata is used for metrics and logging purposes.
3+
/// Contains processed data and associated transaction metadata.
4+
///
5+
/// The processed data is extracted from transactions and the
6+
/// TransactionContext contains additional metadata about which transactions the extracted
7+
/// data originated from. The metadata is used for metrics and logging purposes.
68
#[derive(Clone, Default)]
79
pub struct TransactionContext<T> {
810
pub data: Vec<T>,

rust/sdk/src/utils/convert.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use serde_json::Value;
1010
use std::str::FromStr;
1111
use tiny_keccak::{Hasher, Sha3};
1212

13-
/// Standardizes an address / table handle to be a string with length 66 (0x+64 length
14-
/// hex string).
13+
#[allow(clippy::too_long_first_doc_paragraph)]
14+
/// Standardizes an address / table handle to be a string with length 66 (0x+64 length hex string).
1515
pub fn standardize_address(handle: &str) -> String {
1616
if let Some(handle) = handle.strip_prefix("0x") {
1717
format!("0x{:0>64}", handle)
@@ -20,8 +20,8 @@ pub fn standardize_address(handle: &str) -> String {
2020
}
2121
}
2222

23-
/// Standardizes an address / table handle to be a string with length 66 (0x+64 length
24-
/// hex string).
23+
#[allow(clippy::too_long_first_doc_paragraph)]
24+
/// Standardizes an address / table handle to be a string with length 66 (0x+64 length hex string).
2525
pub fn standardize_address_from_bytes(bytes: &[u8]) -> String {
2626
let encoded_bytes = hex::encode(bytes);
2727
standardize_address(&encoded_bytes)

rust/sdk/src/utils/extract.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,10 @@ pub fn get_payload_type(payload: &TransactionPayload) -> String {
102102
payload.r#type().as_str_name().to_string()
103103
}
104104

105-
/// Part of the json comes escaped from the protobuf so we need to unescape in a safe way
106-
/// This function converts the string into json recursively and lets the diesel ORM handles
107-
/// the escaping.
105+
#[allow(clippy::too_long_first_doc_paragraph)]
106+
/// Part of the json comes escaped from the protobuf so we need to unescape in a safe way.
107+
/// This function converts the string into json recursively
108+
/// and lets the diesel ORM handles the escaping.
108109
pub fn get_clean_payload(payload: &TransactionPayload, version: i64) -> Option<Value> {
109110
if payload.payload.as_ref().is_none() {
110111
// PROCESSOR_UNKNOWN_TYPE_COUNT
@@ -167,8 +168,9 @@ pub fn get_clean_payload(payload: &TransactionPayload, version: i64) -> Option<V
167168
}
168169
}
169170

170-
/// Part of the json comes escaped from the protobuf so we need to unescape in a safe way
171-
/// Note that DirectWriteSet is just events + writeset which is already represented separately
171+
#[allow(clippy::too_long_first_doc_paragraph)]
172+
/// Part of the json comes escaped from the protobuf so we need to unescape in a safe way.
173+
/// /// Note that DirectWriteSet is just events + writeset which is already represented separately
172174
pub fn get_clean_writeset(writeset: &WriteSet, version: i64) -> Option<Value> {
173175
match writeset.write_set.as_ref().unwrap() {
174176
WriteSetType::ScriptWriteSet(inner) => {
@@ -186,6 +188,7 @@ pub fn get_clean_writeset(writeset: &WriteSet, version: i64) -> Option<Value> {
186188
}
187189
}
188190

191+
#[allow(clippy::too_long_first_doc_paragraph)]
189192
/// Part of the json comes escaped from the protobuf so we need to unescape in a safe way
190193
fn get_clean_entry_function_payload(
191194
payload: &EntryFunctionPayload,
@@ -207,7 +210,8 @@ fn get_clean_entry_function_payload(
207210
}
208211
}
209212

210-
/// Part of the json comes escaped from the protobuf so we need to unescape in a safe way
213+
/// Part of the json comes escaped from the protobuf
214+
/// so we need to unescape in a safe way
211215
fn get_clean_script_payload(payload: &ScriptPayload, version: i64) -> ScriptPayloadClean {
212216
ScriptPayloadClean {
213217
code: payload.code.clone(),

0 commit comments

Comments
 (0)