File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -299,14 +299,16 @@ impl<'executable> Executable<'executable, '_> {
299
299
self
300
300
}
301
301
302
- /// Load `self.client` if not yet loaded, then return a reference to it.
303
- async fn get_qcs_client ( & mut self ) -> Result < Arc < Qcs > , Error > {
302
+ /// Get a reference to the [`Qcs`] client used by the executable.
303
+ ///
304
+ /// If one has not been set, a default client is loaded, set, and returned.
305
+ pub async fn qcs_client ( & mut self ) -> Arc < Qcs > {
304
306
if let Some ( client) = & self . qcs_client {
305
- Ok ( client. clone ( ) )
307
+ client. clone ( )
306
308
} else {
307
309
let client = Arc :: new ( Qcs :: load ( ) . await ) ;
308
310
self . qcs_client = Some ( client. clone ( ) ) ;
309
- Ok ( client)
311
+ client
310
312
}
311
313
}
312
314
}
@@ -412,7 +414,7 @@ impl<'execution> Executable<'_, 'execution> {
412
414
self . quil . clone ( ) ,
413
415
self . shots ,
414
416
id,
415
- self . get_qcs_client ( ) . await ? ,
417
+ self . qcs_client ( ) . await ,
416
418
self . quilc_client . clone ( ) ,
417
419
self . compiler_options ,
418
420
)
@@ -852,7 +854,7 @@ mod describe_qpu_for_id {
852
854
"" . into ( ) ,
853
855
shots,
854
856
"Aspen-M-3" . into ( ) ,
855
- exe. get_qcs_client ( ) . await . expect ( "should have client" ) ,
857
+ exe. qcs_client ( ) . await ,
856
858
exe. quilc_client . clone ( ) ,
857
859
CompilerOpts :: default ( ) ,
858
860
)
You can’t perform that action at this time.
0 commit comments