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

Commit

Permalink
Fix new warnings added in recent Rust versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgranade committed Feb 1, 2022
1 parent e1f83ff commit 7b876c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Simulation/qdk_sim_rs/benches/c_api_benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ fn with_test_suite<T: criterion::measurement::Measurement>(
fn ideal(c: &mut Criterion) {
let mut sim_id: usize = 0;
unsafe {
let _err = c_api::init(3, CString::new("mixed").unwrap().as_ptr(), &mut sim_id);
let repr = CString::new("mixed").unwrap();
let _err = c_api::init(3, repr.as_ptr(), &mut sim_id);
}
let mut group = c.benchmark_group("ideal");
with_test_suite(sim_id, &mut group);
Expand All @@ -57,7 +58,8 @@ fn ideal(c: &mut Criterion) {
fn noisy(c: &mut Criterion) {
let mut sim_id: usize = 0;
unsafe {
let _err = c_api::init(3, CString::new("mixed").unwrap().as_ptr(), &mut sim_id);
let repr = CString::new("mixed").unwrap();
let _err = c_api::init(3, repr.as_ptr(), &mut sim_id);
}
// NB: The C API is not in general safe.
unsafe {
Expand Down
2 changes: 1 addition & 1 deletion src/Simulation/qdk_sim_rs/tests/chp_simulation_tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

use qdk_sim::{Pauli, Process, State, Tableau};
use qdk_sim::{Pauli, Process, State};

#[test]
fn pauli_channel_applies_correctly() -> Result<(), String> {
Expand Down

0 comments on commit 7b876c8

Please sign in to comment.