@@ -2064,7 +2064,7 @@ impl<T: ConfigurableDb + Send + Sync> ConfigManager for DbConfigManger<T> {
20642064 self . cfg . update ( change. clone ( ) ) ?;
20652065 let change_str = format ! ( "{:?}" , change) ;
20662066 let mut change: Vec < ( String , ConfigValue ) > = change. into_iter ( ) . collect ( ) ;
2067- let cf_config = change. drain_filter ( |( name, _) | name. ends_with ( "cf" ) ) ;
2067+ let cf_config = change. extract_if ( |( name, _) | name. ends_with ( "cf" ) ) ;
20682068 for ( cf_name, cf_change) in cf_config {
20692069 if let ConfigValue :: Module ( mut cf_change) = cf_change {
20702070 // defaultcf -> default
@@ -2098,7 +2098,7 @@ impl<T: ConfigurableDb + Send + Sync> ConfigManager for DbConfigManger<T> {
20982098 }
20992099
21002100 if let Some ( rate_bytes_config) = change
2101- . drain_filter ( |( name, _) | name == "rate_bytes_per_sec" )
2101+ . extract_if ( |( name, _) | name == "rate_bytes_per_sec" )
21022102 . next ( )
21032103 {
21042104 let rate_bytes_per_sec: ReadableSize = rate_bytes_config. 1 . into ( ) ;
@@ -2107,7 +2107,7 @@ impl<T: ConfigurableDb + Send + Sync> ConfigManager for DbConfigManger<T> {
21072107 }
21082108
21092109 if let Some ( rate_bytes_config) = change
2110- . drain_filter ( |( name, _) | name == "rate_limiter_auto_tuned" )
2110+ . extract_if ( |( name, _) | name == "rate_limiter_auto_tuned" )
21112111 . next ( )
21122112 {
21132113 let rate_limiter_auto_tuned: bool = rate_bytes_config. 1 . into ( ) ;
@@ -2116,30 +2116,30 @@ impl<T: ConfigurableDb + Send + Sync> ConfigManager for DbConfigManger<T> {
21162116 }
21172117
21182118 if let Some ( size) = change
2119- . drain_filter ( |( name, _) | name == "write_buffer_limit" )
2119+ . extract_if ( |( name, _) | name == "write_buffer_limit" )
21202120 . next ( )
21212121 {
21222122 let size: ReadableSize = size. 1 . into ( ) ;
21232123 self . db . set_flush_size ( size. 0 as usize ) ?;
21242124 }
21252125
21262126 if let Some ( f) = change
2127- . drain_filter ( |( name, _) | name == "write_buffer_flush_oldest_first" )
2127+ . extract_if ( |( name, _) | name == "write_buffer_flush_oldest_first" )
21282128 . next ( )
21292129 {
21302130 self . db . set_flush_oldest_first ( f. 1 . into ( ) ) ?;
21312131 }
21322132
21332133 if let Some ( background_jobs_config) = change
2134- . drain_filter ( |( name, _) | name == "max_background_jobs" )
2134+ . extract_if ( |( name, _) | name == "max_background_jobs" )
21352135 . next ( )
21362136 {
21372137 let max_background_jobs: i32 = background_jobs_config. 1 . into ( ) ;
21382138 self . update_background_cfg ( max_background_jobs, self . cfg . max_background_flushes ) ?;
21392139 }
21402140
21412141 if let Some ( background_subcompactions_config) = change
2142- . drain_filter ( |( name, _) | name == "max_sub_compactions" )
2142+ . extract_if ( |( name, _) | name == "max_sub_compactions" )
21432143 . next ( )
21442144 {
21452145 let max_subcompactions: u32 = background_subcompactions_config. 1 . into ( ) ;
@@ -2148,7 +2148,7 @@ impl<T: ConfigurableDb + Send + Sync> ConfigManager for DbConfigManger<T> {
21482148 }
21492149
21502150 if let Some ( background_flushes_config) = change
2151- . drain_filter ( |( name, _) | name == "max_background_flushes" )
2151+ . extract_if ( |( name, _) | name == "max_background_flushes" )
21522152 . next ( )
21532153 {
21542154 let max_background_flushes: i32 = background_flushes_config. 1 . into ( ) ;
0 commit comments