What changed, and why it matters
This commit only reformats Rust source code and reorders import statements. There are no functional changes, no bug fixes, and no security-related modifications.
No security action needed. This is a routine formatting cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff consists entirely of code-formatting changes: adding/removing whitespace, breaking long match arms across lines, reordering use statements, and removing trailing commas. No logic, control flow, data handling, or cryptographic operations were altered. The commit title ‘fix rust code format’ accurately describes the change.
Changed components
rust/rust_c/src/common/ur_ext.rsrust/rust_c/src/tron/mod.rsrust/rust_c/src/tron/structs.rsInspect captured patch +17 / −14
diff --git a/rust/rust_c/src/common/ur_ext.rs b/rust/rust_c/src/common/ur_ext.rs
index d279b90..28060ba 100644
--- a/rust/rust_c/src/common/ur_ext.rs
+++ b/rust/rust_c/src/common/ur_ext.rs
@@ -235,7 +235,9 @@ impl InferViewType for TronSignRequest {
fn infer(&self) -> Result<ViewType, URError> {
match self.get_data_type() {
ur_registry::tron::tron_sign_request::DataType::Transaction => Ok(ViewType::TronTx),
- ur_registry::tron::tron_sign_request::DataType::PersonalMessage=> Ok(ViewType::TronPersonalMessage),
+ ur_registry::tron::tron_sign_request::DataType::PersonalMessage => {
+ Ok(ViewType::TronPersonalMessage)
+ }
}
}
}
diff --git a/rust/rust_c/src/tron/mod.rs b/rust/rust_c/src/tron/mod.rs
index cf354c3..ae6abb0 100644
--- a/rust/rust_c/src/tron/mod.rs
+++ b/rust/rust_c/src/tron/mod.rs
@@ -15,13 +15,13 @@ use cty::c_char;
use structs::{DisplayTron, TransactionType};
use crate::extract_ptr_with_type;
+use alloc::format;
+use app_tron::structs::PersonalMessage;
+use keystore::algorithms::secp256k1::derive_public_key;
+use structs::DisplayTRONPersonalMessage;
use ur_registry::traits::{RegistryItem, To};
use ur_registry::tron::tron_sign_request::TronSignRequest;
use ur_registry::tron::tron_signature::TronSignature;
-use structs::{DisplayTRONPersonalMessage,};
-use app_tron::structs::{PersonalMessage};
-use keystore::algorithms::secp256k1::derive_public_key;
-use alloc::{format};
use app_tron::TxParser;
@@ -65,12 +65,11 @@ pub unsafe extern "C" fn tron_check_sign_request(
Err(e) => TransactionCheckResult::from(e).c_ptr(),
}
}
- TransactionType::PersonalMessage => {
- TransactionCheckResult::new().c_ptr()
- }
+ TransactionType::PersonalMessage => TransactionCheckResult::new().c_ptr(),
_ => TransactionCheckResult::from(RustCError::UnsupportedTransaction(
"Unsupported Transaction Type".to_string(),
- )).c_ptr(),
+ ))
+ .c_ptr(),
}
}
@@ -115,7 +114,7 @@ pub unsafe extern "C" fn tron_sign_request(
let signed_tx_hex = match TransactionType::from(req.get_data_type()) {
TransactionType::Transaction => {
- app_tron::sign_tx_request(&sign_data, &path, seed_slice,)
+ app_tron::sign_tx_request(&sign_data, &path, seed_slice)
.map_err(|e| KeystoneError::SignTxFailed(e.to_string()))?
}
TransactionType::PersonalMessage => {
@@ -123,7 +122,9 @@ pub unsafe extern "C" fn tron_sign_request(
.map_err(|e| KeystoneError::SignTxFailed(e.to_string()))?
}
_ => {
- return Err(KeystoneError::SignTxFailed("Unsupported Transaction Type".to_string()));
+ return Err(KeystoneError::SignTxFailed(
+ "Unsupported Transaction Type".to_string(),
+ ));
}
};
@@ -259,7 +260,7 @@ pub unsafe extern "C" fn tron_parse_personal_message(
) -> PtrT<TransactionParseResult<DisplayTRONPersonalMessage>> {
let crypto_trx = extract_ptr_with_type!(ptr, TronSignRequest);
let xpub = recover_c_char(xpub);
-
+
let pubkey = try_get_trx_public_key(xpub, crypto_trx).ok();
let transaction_type = TransactionType::from(crypto_trx.get_data_type());
diff --git a/rust/rust_c/src/tron/structs.rs b/rust/rust_c/src/tron/structs.rs
index 928678d..9595dac 100644
--- a/rust/rust_c/src/tron/structs.rs
+++ b/rust/rust_c/src/tron/structs.rs
@@ -6,9 +6,9 @@ use crate::common::structs::TransactionParseResult;
use crate::common::types::{PtrString, PtrT};
use crate::common::utils::convert_c_char;
use crate::{check_and_free_ptr, free_str_ptr, impl_c_ptr, make_free_method};
-use ur_registry::tron::tron_sign_request::DataType;
-use app_tron::structs::{PersonalMessage};
+use app_tron::structs::PersonalMessage;
use core::ptr::null_mut;
+use ur_registry::tron::tron_sign_request::DataType;
#[repr(C)]
pub struct DisplayTron {
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.