Skip to content

Commit

Permalink
!fixup more clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dmkozh committed Dec 10, 2024
1 parent eb9a838 commit 87da365
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions soroban-env-host/src/builtin_contracts/contract_error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(non_local_definitions)]
use num_derive::FromPrimitive;
use soroban_env_common::Error;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use super::storage_types::{BalanceValue, BALANCE_EXTEND_AMOUNT, BALANCE_TTL_THRE
/// semantics have been implemented for these balances. If the asset issuer has
/// the AUTH_REQUIRED flag set, then the non-account identifier must first be authorized
/// by the issuer/admin before it's allowed to hold a balance.
//
// Metering: covered by components.
pub(crate) fn read_balance(e: &Host, addr: Address) -> Result<i128, HostError> {
match addr.to_sc_address()? {
Expand Down
1 change: 1 addition & 0 deletions soroban-env-host/src/crypto/bls12_381.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub(crate) const G2_SERIALIZED_SIZE: usize = FP2_SERIALIZED_SIZE * 2;
pub(crate) const FR_SERIALIZED_SIZE: usize = 32;

#[inline(always)]
#[allow(clippy::manual_div_ceil)]
fn units_of_fp<const EXPECTED_SIZE: usize>() -> u64 {
((EXPECTED_SIZE + FP_SERIALIZED_SIZE - 1) / FP_SERIALIZED_SIZE) as u64
}
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-host/src/e2e_invoke.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ struct StorageMapSnapshotSource<'a> {
map: &'a StorageMap,
}

impl<'a> SnapshotSource for StorageMapSnapshotSource<'a> {
impl SnapshotSource for StorageMapSnapshotSource<'_> {
fn get(&self, key: &Rc<LedgerKey>) -> Result<Option<EntryWithLiveUntil>, HostError> {
if let Some(Some((entry, live_until_ledger))) =
self.map.get::<Rc<LedgerKey>>(key, self.budget)?
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-host/src/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// This is technically not part of the Soroban host and is provided here for
/// the sake of sharing between the systems that run Soroban host (such as
/// Stellar core or Soroban RPC service).
///
/// Rough estimate of the base size of any transaction result in the archives
/// (independent of the transaction envelope size).
pub const TX_BASE_RESULT_SIZE: u32 = 300;
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-host/src/host/metered_xdr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct MeteredWrite<'a, W: Write> {
w: &'a mut W,
}

impl<'a, W> Write for MeteredWrite<'a, W>
impl<W> Write for MeteredWrite<'_, W>
where
W: Write,
{
Expand Down
6 changes: 3 additions & 3 deletions soroban-env-host/src/host/trace/fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::{TraceEvent, TraceState};
use crate::{host::Frame, xdr::ContractExecutable, Symbol, SymbolObject, SymbolSmall, Val};
use core::fmt::{Debug, Display};

impl<'a> Debug for TraceEvent<'a> {
impl Debug for TraceEvent<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
TraceEvent::Begin => write!(f, "TraceEvent::Begin"),
Expand Down Expand Up @@ -86,7 +86,7 @@ impl Display for FrameId {
}
}

impl<'a> TraceEvent<'a> {
impl TraceEvent<'_> {
pub fn is_begin(&self) -> bool {
match self {
TraceEvent::Begin => true,
Expand Down Expand Up @@ -146,7 +146,7 @@ impl<'a> TraceEvent<'a> {
}
}

impl<'a> Display for TraceEvent<'a> {
impl Display for TraceEvent<'_> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
TraceEvent::PushCtx(ctx) => {
Expand Down
1 change: 0 additions & 1 deletion soroban-env-host/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ impl Vm {
/// With the introduction of the granular cost inputs this method
/// should only be used for the one-off full parses of the new Wasms
/// during the initial upload verification.
pub fn new(host: &Host, contract_id: Hash, wasm: &[u8]) -> Result<Rc<Self>, HostError> {
let cost_inputs = VersionedContractCodeCostInputs::V0 {
wasm_bytes: wasm.len(),
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-host/src/vm/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl RelativeObjectConversion for U32Val {}
///////////////////////////////////////////////////////////////////////////////
/// X-macro use: dispatch functions
///////////////////////////////////////////////////////////////////////////////

//
// This is a callback macro that pattern-matches the token-tree passed by the
// x-macro (call_macro_with_all_host_functions) and produces a suite of
// dispatch-function definitions.
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-host/src/vm/func_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ macro_rules! host_function_info_helper {
///////////////////////////////////////////////////////////////////////////////
/// X-macro use: static HOST_FUNCTIONS array of HostFuncInfo
///////////////////////////////////////////////////////////////////////////////

//
// This is a callback macro that pattern-matches the token-tree passed by the
// x-macro (call_macro_with_all_host_functions) and produces a suite of
// dispatch-function definitions.
Expand Down

0 comments on commit 87da365

Please sign in to comment.