Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 7b876c8

Browse files
committed
Fix new warnings added in recent Rust versions.
1 parent e1f83ff commit 7b876c8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Simulation/qdk_sim_rs/benches/c_api_benchmark.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ fn with_test_suite<T: criterion::measurement::Measurement>(
4646
fn ideal(c: &mut Criterion) {
4747
let mut sim_id: usize = 0;
4848
unsafe {
49-
let _err = c_api::init(3, CString::new("mixed").unwrap().as_ptr(), &mut sim_id);
49+
let repr = CString::new("mixed").unwrap();
50+
let _err = c_api::init(3, repr.as_ptr(), &mut sim_id);
5051
}
5152
let mut group = c.benchmark_group("ideal");
5253
with_test_suite(sim_id, &mut group);
@@ -57,7 +58,8 @@ fn ideal(c: &mut Criterion) {
5758
fn noisy(c: &mut Criterion) {
5859
let mut sim_id: usize = 0;
5960
unsafe {
60-
let _err = c_api::init(3, CString::new("mixed").unwrap().as_ptr(), &mut sim_id);
61+
let repr = CString::new("mixed").unwrap();
62+
let _err = c_api::init(3, repr.as_ptr(), &mut sim_id);
6163
}
6264
// NB: The C API is not in general safe.
6365
unsafe {

src/Simulation/qdk_sim_rs/tests/chp_simulation_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
use qdk_sim::{Pauli, Process, State, Tableau};
4+
use qdk_sim::{Pauli, Process, State};
55

66
#[test]
77
fn pauli_channel_applies_correctly() -> Result<(), String> {

0 commit comments

Comments
 (0)