@@ -67,14 +67,14 @@ use namada::types::time::DateTimeUtc;
6767use namada:: types:: token:: ConversionState ;
6868use namada:: types:: { ethereum_events, ethereum_structs} ;
6969use rayon:: prelude:: * ;
70-
71- use crate :: config:: utils:: num_of_threads;
72- use crate :: rocksdb:: {
70+ use rocksdb:: {
7371 BlockBasedOptions , ColumnFamily , ColumnFamilyDescriptor , DBCompactionStyle ,
7472 DBCompressionType , Direction , FlushOptions , IteratorMode , Options ,
7573 ReadOptions , WriteBatch ,
7674} ;
7775
76+ use crate :: config:: utils:: num_of_threads;
77+
7878// TODO the DB schema will probably need some kind of versioning
7979
8080/// Env. var to set a number of Rayon global worker threads
@@ -93,7 +93,7 @@ const NEW_DIFF_PREFIX: &str = "new";
9393
9494/// RocksDB handle
9595#[ derive( Debug ) ]
96- pub struct RocksDB ( crate :: rocksdb:: DB ) ;
96+ pub struct RocksDB ( rocksdb:: DB ) ;
9797
9898/// DB Handle for batch writes.
9999#[ derive( Default ) ]
@@ -102,7 +102,7 @@ pub struct RocksDBWriteBatch(WriteBatch);
102102/// Open RocksDB for the DB
103103pub fn open (
104104 path : impl AsRef < Path > ,
105- cache : Option < & crate :: rocksdb:: Cache > ,
105+ cache : Option < & rocksdb:: Cache > ,
106106) -> Result < RocksDB > {
107107 let logical_cores = num_cpus:: get ( ) ;
108108 let compaction_threads = num_of_threads (
@@ -190,7 +190,7 @@ pub fn open(
190190 replay_protection_cf_opts,
191191 ) ) ;
192192
193- crate :: rocksdb:: DB :: open_cf_descriptors ( & db_opts, path, cfs)
193+ rocksdb:: DB :: open_cf_descriptors ( & db_opts, path, cfs)
194194 . map ( RocksDB )
195195 . map_err ( |e| Error :: DBError ( e. into_string ( ) ) )
196196}
@@ -636,7 +636,7 @@ impl RocksDB {
636636}
637637
638638impl DB for RocksDB {
639- type Cache = crate :: rocksdb:: Cache ;
639+ type Cache = rocksdb:: Cache ;
640640 type WriteBatch = RocksDBWriteBatch ;
641641
642642 fn open (
@@ -1680,7 +1680,7 @@ fn iter_prefix<'a>(
16801680
16811681#[ derive( Debug ) ]
16821682pub struct PersistentPrefixIterator < ' a > (
1683- PrefixIterator < crate :: rocksdb:: DBIterator < ' a > > ,
1683+ PrefixIterator < rocksdb:: DBIterator < ' a > > ,
16841684) ;
16851685
16861686impl < ' a > Iterator for PersistentPrefixIterator < ' a > {
@@ -1755,7 +1755,7 @@ fn unknown_key_error(key: &str) -> Result<()> {
17551755
17561756/// Try to increase NOFILE limit and set the `max_open_files` limit to it in
17571757/// RocksDB options.
1758- fn set_max_open_files ( cf_opts : & mut crate :: rocksdb:: Options ) {
1758+ fn set_max_open_files ( cf_opts : & mut rocksdb:: Options ) {
17591759 #[ cfg( unix) ]
17601760 imp:: set_max_open_files ( cf_opts) ;
17611761 // Nothing to do on non-unix
@@ -1771,7 +1771,7 @@ mod imp {
17711771
17721772 const DEFAULT_NOFILE_LIMIT : Rlim = Rlim :: from_raw ( 16384 ) ;
17731773
1774- pub fn set_max_open_files ( cf_opts : & mut crate :: rocksdb:: Options ) {
1774+ pub fn set_max_open_files ( cf_opts : & mut rocksdb:: Options ) {
17751775 let max_open_files = match increase_nofile_limit ( ) {
17761776 Ok ( max_open_files) => Some ( max_open_files) ,
17771777 Err ( err) => {
0 commit comments