diff --git a/.clippy.toml b/.clippy.toml index 58bcfa64c78..7ac7da25238 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -20,6 +20,10 @@ path = "std::sync::Mutex" reason = """the standard library synchronization primitives are poisoned when aquiring threads panic. use parking_lot::Mutex instead to silently ignore panics.""" +[[disallowed-types]] +path = "multihash_codetable::Code" +reason = """use `crate::utils::multihash::MultihashCode` instead which has `Identity` code back-filled.""" + [[disallowed-methods]] path = "tempfile::NamedTempFile::new" reason = """The temporary files created by this method are not persistable if the temporary directory lives on a different filesystem than the target directory. While it is valid in other contexts (if not persisting files), it was misused many times and so we are banning it. Consider using `tempfile::NamedTempFile::new_in` or `tempfile::NamedTempFile::Builder""" diff --git a/src/utils/db/mod.rs b/src/utils/db/mod.rs index 0c95a596185..aeed40a9617 100644 --- a/src/utils/db/mod.rs +++ b/src/utils/db/mod.rs @@ -10,6 +10,7 @@ use cid::Cid; use fvm_ipld_blockstore::Blockstore; use fvm_ipld_encoding::CborStore; use fvm_ipld_encoding::{to_vec, DAG_CBOR}; +#[allow(clippy::disallowed_types)] use multihash_codetable::Code; use serde::ser::Serialize; @@ -17,6 +18,7 @@ use serde::ser::Serialize; /// Extension methods for inserting and retrieving IPLD data with CIDs pub trait BlockstoreExt: Blockstore { /// Batch put CBOR objects into block store and returns vector of CIDs + #[allow(clippy::disallowed_types)] fn bulk_put<'a, S, V>(&self, values: V, code: Code) -> anyhow::Result> where Self: Sized, @@ -59,6 +61,7 @@ pub trait CborStoreExt: CborStore { /// mhType := uint64(mh.BLAKE2B_MIN + 31) /// // 45569 + 31 = 45600 = 0xb220 /// ``` + #[allow(clippy::disallowed_types)] fn default_code() -> Code { Code::Blake2b256 }