@@ -26,7 +26,7 @@ use crate::{
2626 WriteBatch , WriteOptions , DEFAULT_COLUMN_FAMILY_NAME ,
2727} ;
2828
29- use libc:: { self , c_char, c_int, c_uchar , c_void, size_t} ;
29+ use libc:: { self , c_char, c_int, c_void, size_t} ;
3030use std:: collections:: BTreeMap ;
3131use std:: ffi:: { CStr , CString } ;
3232use std:: fmt;
@@ -331,7 +331,7 @@ impl<T: ThreadMode> DBWithThreadMode<T> {
331331
332332 /// Opens the database with a Time to Live compaction filter and column family names.
333333 ///
334- /// Column families opened using this function will be created with default `Options`.
334+ /// Column families opened using this function will be created with default `Options`.
335335 pub fn open_cf_with_ttl < P , I , N > (
336336 opts : & Options ,
337337 path : P ,
@@ -614,7 +614,7 @@ impl<T: ThreadMode> DBWithThreadMode<T> {
614614 } => ffi_try ! ( ffi:: rocksdb_open_for_read_only(
615615 opts. inner,
616616 cpath. as_ptr( ) as * const _,
617- error_if_log_file_exist as c_uchar ,
617+ u8 :: from ( error_if_log_file_exist) ,
618618 ) ) ,
619619 AccessType :: ReadWrite => {
620620 ffi_try ! ( ffi:: rocksdb_open( opts. inner, cpath. as_ptr( ) as * const _) )
@@ -636,13 +636,14 @@ impl<T: ThreadMode> DBWithThreadMode<T> {
636636 Ok ( db)
637637 }
638638
639+ #[ allow( clippy:: pedantic) ]
639640 fn open_cf_raw (
640641 opts : & Options ,
641642 cpath : & CString ,
642643 cfs_v : & [ ColumnFamilyDescriptor ] ,
643644 cfnames : & [ * const c_char ] ,
644645 cfopts : & [ * const ffi:: rocksdb_options_t ] ,
645- cfhandles : & mut Vec < * mut ffi:: rocksdb_column_family_handle_t > ,
646+ cfhandles : & mut [ * mut ffi:: rocksdb_column_family_handle_t ] ,
646647 access_type : & AccessType ,
647648 ) -> Result < * mut ffi:: rocksdb_t , Error > {
648649 let db = unsafe {
@@ -656,7 +657,7 @@ impl<T: ThreadMode> DBWithThreadMode<T> {
656657 cfnames. as_ptr( ) ,
657658 cfopts. as_ptr( ) ,
658659 cfhandles. as_mut_ptr( ) ,
659- error_if_log_file_exist as c_uchar ,
660+ u8 :: from ( error_if_log_file_exist) ,
660661 ) ) ,
661662 AccessType :: ReadWrite => ffi_try ! ( ffi:: rocksdb_open_column_families(
662663 opts. inner,
@@ -737,7 +738,7 @@ impl<T: ThreadMode> DBWithThreadMode<T> {
737738 /// the data to disk.
738739 pub fn flush_wal ( & self , sync : bool ) -> Result < ( ) , Error > {
739740 unsafe {
740- ffi_try ! ( ffi:: rocksdb_flush_wal( self . inner, sync as u8 ) ) ;
741+ ffi_try ! ( ffi:: rocksdb_flush_wal( self . inner, u8 :: from ( sync ) ) ) ;
741742 }
742743 Ok ( ( ) )
743744 }
@@ -1891,7 +1892,7 @@ impl<T: ThreadMode> DBWithThreadMode<T> {
18911892 /// Request stopping background work, if wait is true wait until it's done.
18921893 pub fn cancel_all_background_work ( & self , wait : bool ) {
18931894 unsafe {
1894- ffi:: rocksdb_cancel_all_background_work ( self . inner , wait as u8 ) ;
1895+ ffi:: rocksdb_cancel_all_background_work ( self . inner , u8 :: from ( wait ) ) ;
18951896 }
18961897 }
18971898
0 commit comments