File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -282,6 +282,12 @@ impl InitFeatures {
282
282
}
283
283
self
284
284
}
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
+ }
285
291
}
286
292
287
293
impl < T : sealed:: Context > Features < T > {
@@ -305,7 +311,7 @@ impl<T: sealed::Context> Features<T> {
305
311
306
312
/// Converts `Features<T>` to `Features<C>`. Only known `T` features relevant to context `C` are
307
313
/// 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 > {
309
315
let byte_count = C :: KNOWN_FEATURE_MASK . len ( ) ;
310
316
let mut flags = Vec :: new ( ) ;
311
317
for ( i, byte) in self . flags . iter ( ) . enumerate ( ) {
@@ -523,7 +529,7 @@ mod tests {
523
529
}
524
530
525
531
// 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 ( ) ;
527
533
assert ! ( !features. initial_routing_sync( ) ) ;
528
534
assert ! ( !features. supports_upfront_shutdown_script( ) ) ;
529
535
}
You can’t perform that action at this time.
0 commit comments