Skip to content

Commit

Permalink
wip clippy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Jan 20, 2025
1 parent e1235b2 commit b59c0a7
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 14 deletions.
6 changes: 3 additions & 3 deletions compatibility/src/sdk/v7_libra_framework_sdk_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#![allow(dead_code)]
#![allow(unused_imports)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::too_many_arguments, clippy::doc_lazy_continuation)]
use diem_types::{
account_address::AccountAddress,
transaction::{EntryFunction, TransactionPayload},
Expand All @@ -44,8 +44,8 @@ type Bytes = Vec<u8>;
// explorer and data warehouse
//////// end ////////
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
#[cfg_attr(feature = "fuzzing", derive(proptest_derive::Arbitrary))]
#[cfg_attr(feature = "fuzzing", proptest(no_params))]
// #[cfg_attr(feature = "fuzzing", derive(proptest_derive::Arbitrary))]
// #[cfg_attr(feature = "fuzzing", proptest(no_params))]
pub enum EntryFunctionCall {
/// Offers rotation capability on behalf of `account` to the account at address `recipient_address`.
/// An account can delegate its rotation capability to only one other address at one time. If the account
Expand Down
2 changes: 1 addition & 1 deletion compatibility/src/version_five/hash_value_v5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ impl HashValueV5 {
/// generating basic mock hash values.
///
/// Ex: HashValue::from_u64(0x1234) => HashValue([0, .., 0, 0x12, 0x34])
#[cfg(any(test, feature = "fuzzing"))]
#[cfg(test)]
pub fn from_u64(v: u64) -> Self {
let mut hash = [0u8; Self::LENGTH];
let bytes = v.to_be_bytes();
Expand Down
4 changes: 1 addition & 3 deletions compatibility/src/version_five/state_snapshot_v5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ pub struct AccountStateBlobRecord(HashValueV5, AccountStateBlob);
////// SNAPSHOT FILE IO //////
/// read snapshot manifest file into struct
pub fn v5_read_from_snapshot_manifest(path: &Path) -> Result<StateSnapshotBackupV5, Error> {
let config = std::fs::read_to_string(path).inspect_err(|e| {
format!("Error: cannot read file {:?}, error: {:?}", &path, e);
})?;
let config = std::fs::read_to_string(path).context(format!("Error: cannot read file at {:?}", &path))?;

let map: StateSnapshotBackupV5 = serde_json::from_str(&config)?;

Expand Down
7 changes: 3 additions & 4 deletions compatibility/src/version_five/transaction_manifest_v5.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use anyhow::{ensure, Result};
use anyhow::{ensure, Context, Result};
use diem_backup_cli::storage::FileHandle;
use diem_types::transaction::Version;
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -78,9 +78,8 @@ impl TransactionBackup {
////// TX FILES IO //////
/// read tx manifest file into struct
pub fn v5_read_from_transaction_manifest(path: &Path) -> Result<TransactionBackup> {
let config = std::fs::read_to_string(path).inspect_err(|e| {
format!("Error: cannot read file {:?}, error: {:?}", &path, e);
})?;
let config = std::fs::read_to_string(path).context(
format!("Error: cannot read file {:?}", &path))?;

let map: TransactionBackup = serde_json::from_str(&config)?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#![allow(dead_code)]
#![allow(unused_imports)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::too_many_arguments, clippy::doc_lazy_continuation)]
use diem_types::{
account_address::AccountAddress,
transaction::{EntryFunction, TransactionPayload},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ pub fn write_to_file(result: Vec<(String, String)>, proposal_dir: PathBuf) -> an
/// ... so that we can then submit it as part of a proposal framework/libra-framework/sources/modified_source/diem_governance.move
/// ... so that then the VM doesn't complain about its size /diem-move/diem-vm/src/diem_vm_impl.rs
/// ... and so that when the proposal is approved a third party can execute the source upgrade.
pub fn init_move_dir_wrapper(
package_dir: PathBuf,
script_name: &str,
Expand Down
1 change: 0 additions & 1 deletion types/src/core_types/app_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ pub fn get_nickname(acc: AccountAddress) -> String {
/// Transaction types
#[derive(Debug, Clone, Serialize, Deserialize, clap::ValueEnum)]
#[clap(rename_all = "kebab_case")]

pub enum TxType {
/// critical txs
Baseline,
Expand Down

0 comments on commit b59c0a7

Please sign in to comment.