Merge pull request #2550 from davidhewitt/beta-clippy

clippy: fixes flagged by beta toolchain
This commit is contained in:
David Hewitt 2022-08-14 08:22:08 +01:00 committed by GitHub
commit 15d816d3f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 7 deletions

View File

@ -12,9 +12,7 @@ fn bench_clean_gilpool_new(b: &mut Bencher<'_>) {
fn bench_clean_acquire_gil(b: &mut Bencher<'_>) {
// Acquiring first GIL will also create a "clean" GILPool, so this measures the Python overhead.
b.iter(|| {
let _ = Python::with_gil(|_| {});
});
b.iter(|| Python::with_gil(|_| {}));
}
fn bench_dirty_acquire_gil(b: &mut Bencher<'_>) {
@ -24,9 +22,7 @@ fn bench_dirty_acquire_gil(b: &mut Bencher<'_>) {
// Clone and drop an object so that the GILPool has work to do.
let _ = obj.clone();
},
|_| {
let _ = Python::with_gil(|_| {});
},
|_| Python::with_gil(|_| {}),
BatchSize::NumBatches(1),
);
}

View File

@ -743,7 +743,7 @@ mod tests {
let obj: Arc<Py<PyAny>> = Arc::new(get_object(py));
let thread_obj = Arc::clone(&obj);
let count = (&*obj).get_refcnt(py);
let count = obj.get_refcnt(py);
println!(
"1: The object has been created and its reference count is {}",
count