@@ -63,7 +63,7 @@ impl RuntimeBuilder for ZshRuntimeBuilder {
6363pub struct ZshRuntime {
6464 path : OsString ,
6565 home : PathBuf ,
66- timeout : Duration ,
66+ _timeout : Duration ,
6767}
6868
6969impl ZshRuntime {
@@ -93,7 +93,7 @@ PROMPT='%% '
9393 Ok ( Self {
9494 path,
9595 home,
96- timeout : Duration :: from_millis ( 100 ) ,
96+ _timeout : Duration :: from_millis ( 100 ) ,
9797 } )
9898 }
9999
@@ -110,15 +110,20 @@ PROMPT='%% '
110110 }
111111
112112 /// Get the output from typing `input` into the shell
113- pub fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
113+ pub fn complete (
114+ & mut self ,
115+ input : & str ,
116+ term : & Term ,
117+ timeout : Duration ,
118+ ) -> std:: io:: Result < String > {
114119 let mut command = Command :: new ( "zsh" ) ;
115120 command. arg ( "--noglobalrcs" ) ;
116121 command
117122 . env ( "PATH" , & self . path )
118123 . env ( "TERM" , "xterm" )
119124 . env ( "ZDOTDIR" , & self . home ) ;
120125 let echo = false ;
121- comptest ( command, echo, input, term, self . timeout )
126+ comptest ( command, echo, input, term, timeout)
122127 }
123128}
124129
@@ -131,8 +136,8 @@ impl Runtime for ZshRuntime {
131136 self . register ( name, content)
132137 }
133138
134- fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
135- self . complete ( input, term)
139+ fn complete ( & mut self , input : & str , term : & Term , timeout : Duration ) -> std:: io:: Result < String > {
140+ self . complete ( input, term, timeout )
136141 }
137142}
138143
@@ -164,7 +169,7 @@ pub struct BashRuntime {
164169 path : OsString ,
165170 home : PathBuf ,
166171 config : PathBuf ,
167- timeout : Duration ,
172+ _timeout : Duration ,
168173}
169174
170175impl BashRuntime {
@@ -198,7 +203,7 @@ PS1='% '
198203 path,
199204 home,
200205 config : config_path,
201- timeout : Duration :: from_millis ( 50 ) ,
206+ _timeout : Duration :: from_millis ( 50 ) ,
202207 } )
203208 }
204209
@@ -217,7 +222,12 @@ PS1='% '
217222 }
218223
219224 /// Get the output from typing `input` into the shell
220- pub fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
225+ pub fn complete (
226+ & mut self ,
227+ input : & str ,
228+ term : & Term ,
229+ timeout : Duration ,
230+ ) -> std:: io:: Result < String > {
221231 let mut command = Command :: new ( "bash" ) ;
222232 let inputrc_path = self . home . join ( ".inputrc" ) ;
223233 command
@@ -226,7 +236,7 @@ PS1='% '
226236 . env ( "INPUTRC" , & inputrc_path)
227237 . args ( [ OsStr :: new ( "--rcfile" ) , self . config . as_os_str ( ) ] ) ;
228238 let echo = !input. contains ( "\t \t " ) ;
229- comptest ( command, echo, input, term, self . timeout )
239+ comptest ( command, echo, input, term, timeout)
230240 }
231241}
232242
@@ -239,8 +249,8 @@ impl Runtime for BashRuntime {
239249 self . register ( name, content)
240250 }
241251
242- fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
243- self . complete ( input, term)
252+ fn complete ( & mut self , input : & str , term : & Term , timeout : Duration ) -> std:: io:: Result < String > {
253+ self . complete ( input, term, timeout )
244254 }
245255}
246256
@@ -271,7 +281,7 @@ impl RuntimeBuilder for FishRuntimeBuilder {
271281pub struct FishRuntime {
272282 path : OsString ,
273283 home : PathBuf ,
274- timeout : Duration ,
284+ _timeout : Duration ,
275285}
276286
277287impl FishRuntime {
303313 Ok ( Self {
304314 path,
305315 home,
306- timeout : Duration :: from_millis ( 50 ) ,
316+ _timeout : Duration :: from_millis ( 50 ) ,
307317 } )
308318 }
309319
@@ -320,15 +330,20 @@ end;
320330 }
321331
322332 /// Get the output from typing `input` into the shell
323- pub fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
333+ pub fn complete (
334+ & mut self ,
335+ input : & str ,
336+ term : & Term ,
337+ timeout : Duration ,
338+ ) -> std:: io:: Result < String > {
324339 let mut command = Command :: new ( "fish" ) ;
325340 command
326341 . env ( "PATH" , & self . path )
327342 // fish requires TERM to be set.
328343 . env ( "TERM" , "xterm" )
329344 . env ( "XDG_CONFIG_HOME" , & self . home ) ;
330345 let echo = false ;
331- comptest ( command, echo, input, term, self . timeout )
346+ comptest ( command, echo, input, term, timeout)
332347 }
333348}
334349
@@ -341,8 +356,8 @@ impl Runtime for FishRuntime {
341356 self . register ( name, content)
342357 }
343358
344- fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
345- self . complete ( input, term)
359+ fn complete ( & mut self , input : & str , term : & Term , timeout : Duration ) -> std:: io:: Result < String > {
360+ self . complete ( input, term, timeout )
346361 }
347362}
348363
@@ -374,7 +389,7 @@ pub struct ElvishRuntime {
374389 path : OsString ,
375390 home : PathBuf ,
376391 config : PathBuf ,
377- timeout : Duration ,
392+ _timeout : Duration ,
378393}
379394
380395impl ElvishRuntime {
@@ -403,7 +418,7 @@ set edit:prompt = (constantly \"% \")
403418 path,
404419 home,
405420 config : config_path,
406- timeout : Duration :: from_millis ( 50 ) ,
421+ _timeout : Duration :: from_millis ( 50 ) ,
407422 } )
408423 }
409424
@@ -422,13 +437,18 @@ set edit:prompt = (constantly \"% \")
422437 }
423438
424439 /// Get the output from typing `input` into the shell
425- pub fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
440+ pub fn complete (
441+ & mut self ,
442+ input : & str ,
443+ term : & Term ,
444+ timeout : Duration ,
445+ ) -> std:: io:: Result < String > {
426446 let mut command = Command :: new ( "elvish" ) ;
427447 command
428448 . env ( "PATH" , & self . path )
429449 . env ( "XDG_CONFIG_HOME" , & self . home ) ;
430450 let echo = false ;
431- comptest ( command, echo, input, term, self . timeout )
451+ comptest ( command, echo, input, term, timeout)
432452 }
433453}
434454
@@ -441,8 +461,8 @@ impl Runtime for ElvishRuntime {
441461 self . register ( name, content)
442462 }
443463
444- fn complete ( & mut self , input : & str , term : & Term ) -> std:: io:: Result < String > {
445- self . complete ( input, term)
464+ fn complete ( & mut self , input : & str , term : & Term , timeout : Duration ) -> std:: io:: Result < String > {
465+ self . complete ( input, term, timeout )
446466 }
447467}
448468
0 commit comments