File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,12 @@ impl InitFeatures {
282282 }
283283 self
284284 }
285+
286+ /// Converts `InitFeatures` to `Features<C>`. Only known `InitFeatures` relevant to context `C`
287+ /// are included in the result.
288+ pub ( crate ) fn to_context < C : sealed:: Context > ( & self ) -> Features < C > {
289+ self . to_context_internal ( )
290+ }
285291}
286292
287293impl < T : sealed:: Context > Features < T > {
@@ -305,7 +311,7 @@ impl<T: sealed::Context> Features<T> {
305311
306312 /// Converts `Features<T>` to `Features<C>`. Only known `T` features relevant to context `C` are
307313 /// included in the result.
308- pub ( crate ) fn to_context < C : sealed:: Context > ( & self ) -> Features < C > {
314+ fn to_context_internal < C : sealed:: Context > ( & self ) -> Features < C > {
309315 let byte_count = C :: KNOWN_FEATURE_MASK . len ( ) ;
310316 let mut flags = Vec :: new ( ) ;
311317 for ( i, byte) in self . flags . iter ( ) . enumerate ( ) {
@@ -523,7 +529,7 @@ mod tests {
523529 }
524530
525531 // Check that cleared flags are kept blank when converting back.
526- let features: InitFeatures = node_features. to_context ( ) ;
532+ let features: InitFeatures = node_features. to_context_internal ( ) ;
527533 assert ! ( !features. initial_routing_sync( ) ) ;
528534 assert ! ( !features. supports_upfront_shutdown_script( ) ) ;
529535 }
You can’t perform that action at this time.
0 commit comments