diff --git a/Cargo.lock b/Cargo.lock index 20897875c..3d1c8f331 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1051,9 +1051,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quil-rs" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feff28a69053af88a708e5aaf6b07cb6e0b22567a7c6dde5085311c9879c5c3a" +checksum = "a8dab267ecfb8d9ca6d5cf69885c05a7dd2b4beec32df520ee9b937f99e08596" dependencies = [ "indexmap", "lexical", diff --git a/qcs/Cargo.toml b/qcs/Cargo.toml index 145b9444f..85ff4b8b3 100644 --- a/qcs/Cargo.toml +++ b/qcs/Cargo.toml @@ -20,7 +20,7 @@ lazy_static = "1.4.0" log = "0.4.17" num = "0.4.0" qcs-api = { version = "0.0.6", path = "../qcs-api" } -quil-rs = "0.11.1" +quil-rs = "0.12.0" reqwest = { version = "0.11.11", features = ["rustls", "json"] } rmp-serde = "1.1.0" serde = { version = "1.0.137", features = ["derive"] } diff --git a/qcs/src/qpu/execution.rs b/qcs/src/qpu/execution.rs index ed14093a8..73744f221 100644 --- a/qcs/src/qpu/execution.rs +++ b/qcs/src/qpu/execution.rs @@ -201,12 +201,10 @@ impl<'a> Execution<'a> { NativeQuil::assume_native_quil(quil.to_string()) }; - let program = - NativeQuilProgram::try_from(native_quil).map_err(|e| Error::Quil(format!("{}", e)))?; + let program = NativeQuilProgram::try_from(native_quil).map_err(Error::Quil)?; Ok(Self { - program: RewrittenProgram::try_from(program) - .map_err(|e| Error::Quil(format!("{}", e)))?, + program: RewrittenProgram::try_from(program).map_err(|e| Error::Quil(e.to_string()))?, quantum_processor_id, shots, qcs: None, diff --git a/qcs/src/qvm/execution.rs b/qcs/src/qvm/execution.rs index a16581cf7..0ec1bf2d4 100644 --- a/qcs/src/qvm/execution.rs +++ b/qcs/src/qvm/execution.rs @@ -22,7 +22,7 @@ impl Execution { /// Construct a new [`Execution`] from Quil. Immediately parses the Quil and returns an error if /// there are any problems. pub(crate) fn new(quil: &str) -> Result { - let program = Program::from_str(quil).map_err(|e| Error::Parsing(format!("{}", e)))?; + let program = Program::from_str(quil).map_err(Error::Parsing)?; Ok(Self { program }) }