File tree Expand file tree Collapse file tree 2 files changed +2
-32
lines changed
Expand file tree Collapse file tree 2 files changed +2
-32
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ impl WasmModuleManager {
8585 Ok ( hasher. finalize ( ) . into ( ) )
8686 }
8787
88- fn validate_module_descriptor ( & self , descriptor : WasmModuleDescriptor ) -> Result < ( ) > {
88+ fn validate_module_descriptor ( & self , descriptor : & WasmModuleDescriptor ) -> Result < ( ) > {
8989 if descriptor. name . is_empty ( ) {
9090 return Err ( WasmModuleError :: InvalidDescriptor (
9191 "Module name cannot be empty" . to_string ( ) ,
@@ -109,7 +109,7 @@ impl WasmModuleManager {
109109
110110 pub fn add_module ( & self , descriptor : WasmModuleDescriptor ) -> Result < Uuid > {
111111 // validate the module descriptor
112- self . validate_module_descriptor ( descriptor. clone ( ) ) ?;
112+ self . validate_module_descriptor ( & descriptor) ?;
113113
114114 // calculate the sha256 hash of the module file
115115 let sha256_hash = self . calculate_sha256_hash ( & descriptor. file_path ) ?;
Original file line number Diff line number Diff line change @@ -86,36 +86,6 @@ impl WasmComponentOutput {
8686 }
8787}
8888
89- /// Helper trait for converting from WIT types to component input
90- pub trait ToComponentInput {
91- fn to_component_input ( self ) -> WasmComponentInput ;
92- }
93-
94- /// Helper trait for converting from component output to WIT types
95- pub trait FromComponentOutput {
96- fn from_component_output ( output : & WasmComponentOutput ) -> Option < & Self > ;
97- }
98-
99- impl ToComponentInput for middleware_types:: Request {
100- fn to_component_input ( self ) -> WasmComponentInput {
101- WasmComponentInput :: MiddlewareRequest ( self )
102- }
103- }
104-
105- impl ToComponentInput for middleware_types:: Response {
106- fn to_component_input ( self ) -> WasmComponentInput {
107- WasmComponentInput :: MiddlewareResponse ( self )
108- }
109- }
110-
111- impl FromComponentOutput for middleware_types:: Action {
112- fn from_component_output ( output : & WasmComponentOutput ) -> Option < & Self > {
113- match output {
114- WasmComponentOutput :: MiddlewareAction ( action) => Some ( action) ,
115- }
116- }
117- }
118-
11989pub struct WasiState {
12090 pub ctx : WasiCtx ,
12191 pub table : ResourceTable ,
You can’t perform that action at this time.
0 commit comments