File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ impl RustApi {
261261 format ! ( "/{}" , route. path)
262262 } ;
263263
264- let entry = by_path. entry ( path) . or_insert_with ( MethodRouter :: new ) ;
264+ let entry = by_path. entry ( path) . or_default ( ) ;
265265 entry. insert_boxed_with_operation ( method_enum, route. handler , route. operation ) ;
266266 }
267267
@@ -763,6 +763,12 @@ pub struct RustApiConfig {
763763 layers : LayerStack ,
764764}
765765
766+ impl Default for RustApiConfig {
767+ fn default ( ) -> Self {
768+ Self :: new ( )
769+ }
770+ }
771+
766772impl RustApiConfig {
767773 pub fn new ( ) -> Self {
768774 Self {
@@ -840,7 +846,7 @@ impl RustApiConfig {
840846
841847 // Apply layers
842848 // Note: layers are applied in reverse order in RustApi::layer logic (pushing to vec)
843- app. layers . extend ( self . layers . into_iter ( ) ) ;
849+ app. layers . extend ( self . layers ) ;
844850
845851 app
846852 }
You can’t perform that action at this time.
0 commit comments