File tree Expand file tree Collapse file tree 2 files changed +25
-1
lines changed
Expand file tree Collapse file tree 2 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -382,7 +382,13 @@ pub trait RustGenerator<'a> {
382382 fn modes_of ( & self , ty : TypeId ) -> Vec < ( String , TypeMode ) > {
383383 let info = self . info ( ty) ;
384384 let mut result = Vec :: new ( ) ;
385- result. push ( ( self . result_name ( ty) , TypeMode :: Owned ) ) ;
385+ let first_mode = if info. owned || !info. borrowed {
386+ TypeMode :: Owned
387+ } else {
388+ assert ! ( !self . uses_two_names( & info) ) ;
389+ TypeMode :: AllBorrowed ( "'a" )
390+ } ;
391+ result. push ( ( self . result_name ( ty) , first_mode) ) ;
386392 if self . uses_two_names ( & info) {
387393 result. push ( ( self . param_name ( ty) , TypeMode :: AllBorrowed ( "'a" ) ) ) ;
388394 }
Original file line number Diff line number Diff line change 1+ interface http-fetch-imports {
2+ record request {
3+ method : string ,
4+ uri : string ,
5+ body : string
6+ }
7+
8+ record response {
9+ status : u16 ,
10+ body : string
11+ }
12+
13+ fetch : func (req : request ) -> result <response >
14+ }
15+
16+ default world http-fetch-simple {
17+ import http-fetch-simple : self . http-fetch-imports
18+ }
You can’t perform that action at this time.
0 commit comments